diff --git a/include/mainwindow.h b/include/mainwindow.h index eefbee5..2165dd2 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -31,7 +31,7 @@ public slots: // filemenu actions void newFile(); void openFile(const QString &fileName = ""); - void saveFile(); + void saveFile(const bool &checkIfReadonly = true); bool saveFileAs(); bool closeFile(); void exportScene(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bd772e6..b33445f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -136,10 +136,10 @@ void MainWindow::openFile(const QString &fileName) showMainToolbar(); } -void MainWindow::saveFile() +void MainWindow::saveFile(const bool &checkIfReadonly) { QFileInfo fileInfo(m_fileName); - if (!fileInfo.isWritable()) + if (checkIfReadonly && !fileInfo.isWritable()) { statusBarMsg(tr("Read-only file!")); return; @@ -162,8 +162,8 @@ bool MainWindow::saveFileAs() return false; m_fileName = dialog.selectedFiles().first(); + saveFile(false); setTitle(m_fileName); - saveFile(); return true; }