force save as if file read only (#7100)
This commit is contained in:
committed by
Bertrand Songis
parent
0ebf9dbb1e
commit
64bdcbc4b1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user