From 45aebc627eafafd5393b72a8f04d7c16f3264779 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 24 Dec 2014 16:39:44 +0200 Subject: [PATCH] Delete previous file name from restore list after save as action. --HG-- branch : develop --- src/app/mainwindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 8294e8c80..0069a3a97 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1340,6 +1340,7 @@ bool MainWindow::SaveAs() { fileName += ".val"; } + const QString oldFileName = curFile; QString error; bool result = SavePattern(fileName, error); if (result == false) @@ -1352,6 +1353,13 @@ bool MainWindow::SaveAs() messageBox.setStandardButtons(QMessageBox::Ok); messageBox.exec(); } + if (oldFileName != curFile) + {// Now we have new file name after save as. + // But still have previous name in restore list. We should delete them. + QStringList restoreFiles = qApp->getSettings()->GetRestoreFileList(); + restoreFiles.removeAll(oldFileName); + qApp->getSettings()->SetRestoreFileList(restoreFiles); + } return result; }