summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2016-12-04 10:19:37 (GMT)
committerPino Toscano <pino@kde.org>2016-12-04 10:19:37 (GMT)
commitacb376348fa0baa5d1eab39f08d0a55d2baaf0b0 (patch)
tree310e10f171f69e0fc15c541fae80cbf094592cc1
parent00f861e6050b11597e14c7895abb734b53f1ac39 (diff)
QFileDialog does that by default already, so when saving on an existing file there were two confirmation dialogs (one by QFileDialog, and the second manually done by kturtle).
-rw-r--r--src/editor.cpp6
-rw-r--r--src/mainwindow.cpp20
2 files changed, 0 insertions, 26 deletions
diff --git a/src/editor.cpp b/src/editor.cpp
index a5790cb..030a4c2 100644
--- a/src/editor.cpp
+++ b/src/editor.cpp
@@ -264,12 +264,6 @@ bool Editor::saveFileAs()
QString("%1 (*.turtle);;%2 (*)").arg(i18n("Turtle code files")).arg(i18n("All files"))
);
if (url.isEmpty()) return false;
- KIO::StatJob *job = KIO::stat(url, KIO::StatJob::SourceSide, 0);
- if (job->exec() &&
- KMessageBox::warningContinueCancel(this,
- i18n("Are you sure you want to overwrite %1?", url.fileName()), i18n("Overwrite Existing File"),
- KGuiItem(i18n("&Overwrite")), KStandardGuiItem::cancel(), i18n("&Overwrite")
- ) != KMessageBox::Continue) return false;
bool result = saveFile(url);
return result;
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index e318eb8..cc3e145 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1029,14 +1029,6 @@ void MainWindow::exportToPng()
QString("%1 (*.png);;%2 (*)").arg(i18n("PNG Images")).arg(i18n("All files")));
if (url.isEmpty())
return;
- KIO::StatJob *job = KIO::stat(url, KIO::StatJob::SourceSide, 0);
- if (job->exec() &&
- KMessageBox::warningContinueCancel(this,
- i18n("Are you sure you want to overwrite %1?", url.fileName()),
- i18n("Overwrite Existing File"),KGuiItem(i18n("&Overwrite")),
- KStandardGuiItem::cancel(), i18n("&Overwrite")) != KMessageBox::Continue) {
- return;
- }
// get our image from the canvas and save to png
QImage pict = canvas->getPicture();
if (url.isLocalFile()) {
@@ -1053,12 +1045,6 @@ void MainWindow::exportToSvg()
QString path = QFileDialog::getSaveFileName(this, i18n("Save as SVG"), QString(), QString("%1 (.*svg);;%2 (*)").arg(i18n("Scalable Vector Graphics")).arg(i18n("All files")));
if (path.isEmpty())
return;
- if (QFile::exists(path) &&
- KMessageBox::warningContinueCancel(this,
- i18n("Are you sure you want to overwrite %1?", path),
- i18n("Overwrite Existing File"),KGuiItem(i18n("&Overwrite")),
- KStandardGuiItem::cancel(), i18n("&Overwrite")) != KMessageBox::Continue)
- return;
canvas->saveAsSvg(windowTitle(), path);
}
@@ -1069,12 +1055,6 @@ void MainWindow::exportToHtml()
QString path = QFileDialog::getSaveFileName(this, i18n("Save code as HTML"), QString(), QString("*.html|%1\n*|%2").arg(i18n("HTML documents")).arg(i18n("All files")));
if (path.isEmpty())
return;
- if (QFile::exists(path) &&
- KMessageBox::warningContinueCancel(this,
- i18n("Are you sure you want to overwrite %1?", path),
- i18n("Overwrite Existing File"),KGuiItem(i18n("&Overwrite")),
- KStandardGuiItem::cancel(), i18n("&Overwrite")) != KMessageBox::Continue)
- return;
QSaveFile file(path);
if (!file.open(QIODevice::WriteOnly))
return;