Fixed issue #891. Valentina claims that file was incorrectly saved when used

Save as option.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2018-10-22 12:16:48 +03:00
parent d057fe920f
commit ebd9c626de
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,7 @@
- [#885] Regression. Broken support for multi size measurements. - [#885] Regression. Broken support for multi size measurements.
- Fixed issues with seam allowance. - Fixed issues with seam allowance.
- [#890] Menu Windows->Close pattern doesn't clear "Group of visibility" list. - [#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 # Version 0.6.0 October 1, 2018
- [#682] New feature. Export increments to Excel .csv. - [#682] New feature. Export increments to Excel .csv.

View File

@ -2671,6 +2671,7 @@ void MainWindow::ActionLayout(bool checked)
*/ */
bool MainWindow::SaveAs() bool MainWindow::SaveAs()
{ {
const QString oldFilePath = qApp->GetPatternPath();
QString filters(tr("Pattern files") + QLatin1String("(*.val)")); QString filters(tr("Pattern files") + QLatin1String("(*.val)"));
QString dir; QString dir;
if (qApp->GetPatternPath().isEmpty()) if (qApp->GetPatternPath().isEmpty())
@ -2756,6 +2757,14 @@ bool MainWindow::SaveAs()
RemoveTempDir(); RemoveTempDir();
return result; 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; patternReadOnly = false;