force save as if file read only (#7100)

This commit is contained in:
Neil Horne
2019-11-20 11:57:13 +01:00
committed by Bertrand Songis
parent 0ebf9dbb1e
commit 64bdcbc4b1
+6 -1
View File
@@ -701,6 +701,10 @@ void MdiChild::updateTitle()
if (availableEEpromSize >= 0) {
title += QString(" - %1 ").arg(availableEEpromSize) + tr("free bytes");
}
QFileInfo fi(curFile);
if (!isUntitled && !fi.isWritable()) {
title += QString(" (%1)").arg(tr("read only"));
}
setWindowTitle(title);
}
@@ -1355,7 +1359,8 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile)
bool MdiChild::save()
{
if (isUntitled) {
QFileInfo fi(curFile);
if (isUntitled || !fi.isWritable()) {
return saveAs(true);
}
else {