From: Till Theato Date: Fri, 14 May 2010 10:35:54 +0000 (+0000) Subject: The save file dialog should appear again if we don't want to overwrite the selected... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=3c83ad1b5407a43cee1feffa65e1ab74d61a00f2;p=kdenlive The save file dialog should appear again if we don't want to overwrite the selected file: http://kdenlive.org/mantis/view.php?id=467 svn path=/trunk/kdenlive/; revision=4439 --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7c97a3da..4bfe7c67 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1598,7 +1598,9 @@ bool MainWindow::saveFileAs() QString outputFile = KFileDialog::getSaveFileName(KUrl(), mimetype); if (outputFile.isEmpty()) return false; if (QFile::exists(outputFile)) { - if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it?")) == KMessageBox::No) return false; + // Show the file dialog again if the user does not want to overwrite the file + if (KMessageBox::questionYesNo(this, i18n("File already exists.\nDo you want to overwrite it?")) == KMessageBox::No) + return saveFileAs(); } return saveFileAs(outputFile); } diff --git a/src/mainwindow.h b/src/mainwindow.h index e3ce1835..d4510b1b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -234,8 +234,15 @@ private slots: void connectDocument(TrackView*, KdenliveDoc*); void openFile(); void openLastFile(); + /** @brief Checks whether a URL is available to save to. + * @return Whether the file was saved. */ bool saveFile(); + /** @brief Shows a save file dialog for saving the project. + * @return Whether the file was saved. */ bool saveFileAs(); + /** @brief Set properties to match outputFileName and save the document. + * @param outputFileName The URL to save to / The document's URL. + * @return Whether we had success. */ bool saveFileAs(const QString &outputFileName); void slotPreferences(int page = -1, int option = -1); void updateConfiguration();