From 0d34320e7d2fa4665899316c45ffd14ea0961e18 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 22 Jan 2016 12:54:19 +0200 Subject: [PATCH] The lock file already helps to prevent rewriting current opened pattern file. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 1d15bc4a5..1e4a56c72 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2091,6 +2091,7 @@ bool MainWindow::SaveAs() if (QFileInfo(fileName).exists()) { // Temporary try to lock the file before saving + // Also help to rewite current read-only pattern VLockGuard tmp(fileName); if (not tmp.IsLocked()) { @@ -2100,20 +2101,6 @@ bool MainWindow::SaveAs() } } - if (curFile == fileName && patternReadOnly) - { - const QString message = QString("Failed to save the pattern '%1'. Error writing. The document is read-only.") - .arg(fileName); - QMessageBox messageBox; - messageBox.setIcon(QMessageBox::Critical); - messageBox.setInformativeText(message); - messageBox.setDefaultButton(QMessageBox::Ok); - messageBox.setStandardButtons(QMessageBox::Ok); - messageBox.exec(); - - return false; - } - // Need for restoring previous state in case of failure const bool wasModified = doc->IsModified(); // Need because SetReadOnly() will change internal state const bool readOnly = doc->IsReadOnly();