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

Save as option.
(grafted from 1d7f8c80ceb1d7a320eb81d2a7bd726a018e0e05)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-10-22 12:16:48 +03:00
parent 84bb44943f
commit 2989466c52
2 changed files with 10 additions and 0 deletions

View File

@ -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.

View File

@ -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;