Force ETX file extn on save

This commit is contained in:
elecpower
2021-12-31 10:53:08 +01:00
committed by Raphael Coeffic
parent 76c3dd8240
commit 2e7f20def9
+2 -2
View File
@@ -1360,7 +1360,7 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile)
bool MdiChild::save() bool MdiChild::save()
{ {
QFileInfo fi(curFile); QFileInfo fi(curFile);
if (isUntitled || !fi.isWritable()) { if (isUntitled || !fi.isWritable() || (fi.suffix().toLower() != "etx" && fi.suffix().toLower() != "yml")) {
return saveAs(true); return saveAs(true);
} }
else { else {
@@ -1455,7 +1455,7 @@ void MdiChild::setCurrentFile(const QString & fileName)
void MdiChild::forceNewFilename(const QString & suffix, const QString & ext) void MdiChild::forceNewFilename(const QString & suffix, const QString & ext)
{ {
curFile.replace(QRegExp("\\.(eepe|bin|hex|etx)$"), suffix + "." + ext); curFile.replace(QRegExp("\\.(eepe|bin|hex|otx|etx)$"), suffix + "." + ext);
} }
bool MdiChild::convertStorage(Board::Type from, Board::Type to, bool newFile) bool MdiChild::convertStorage(Board::Type from, Board::Type to, bool newFile)