From 2e7f20def978e927d1c8eb356b9c8fb4cca105a8 Mon Sep 17 00:00:00 2001 From: elecpower Date: Sun, 14 Nov 2021 17:04:02 +1100 Subject: [PATCH] Force ETX file extn on save --- companion/src/mdichild.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index 14a4266b1..dbde4aa3f 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -1360,7 +1360,7 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile) bool MdiChild::save() { QFileInfo fi(curFile); - if (isUntitled || !fi.isWritable()) { + if (isUntitled || !fi.isWritable() || (fi.suffix().toLower() != "etx" && fi.suffix().toLower() != "yml")) { return saveAs(true); } else { @@ -1455,7 +1455,7 @@ void MdiChild::setCurrentFile(const QString & fileName) 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)