From ebd9c626de4fe1686f141c39dd5a4f426ce17821 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 22 Oct 2018 12:16:48 +0300 Subject: [PATCH] Fixed issue #891. Valentina claims that file was incorrectly saved when used Save as option. --HG-- branch : release --- ChangeLog.txt | 1 + src/app/valentina/mainwindow.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 91029558b..1e29228f2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ - [#885] Regression. Broken support for multi size measurements. - Fixed issues with seam allowance. - [#890] Menu Windows->Close pattern doesn't clear "Group of visibility" list. +- [#891] Valentina claims that file was incorrectly saved when used Save as option. # Version 0.6.0 October 1, 2018 - [#682] New feature. Export increments to Excel .csv. diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index d6a128636..cc49e6f97 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2671,6 +2671,7 @@ void MainWindow::ActionLayout(bool checked) */ bool MainWindow::SaveAs() { + const QString oldFilePath = qApp->GetPatternPath(); QString filters(tr("Pattern files") + QLatin1String("(*.val)")); QString dir; if (qApp->GetPatternPath().isEmpty()) @@ -2756,6 +2757,14 @@ bool MainWindow::SaveAs() RemoveTempDir(); return result; } + else if (not oldFilePath.isEmpty()) + { + qCDebug(vMainWindow, "Updating restore file list."); + QStringList restoreFiles = qApp->ValentinaSettings()->GetRestoreFileList(); + restoreFiles.removeAll(oldFilePath); + qApp->ValentinaSettings()->SetRestoreFileList(restoreFiles); + QFile::remove(oldFilePath + *autosavePrefix); + } patternReadOnly = false;