aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSayan Biswas <[email protected]>2015-09-11 03:36:00 +0530
committerSayan Biswas <[email protected]>2015-09-11 03:36:00 +0530
commitdecc26db82a864911889e53a9c9a48c35cd8bf0c (patch)
treed4135ab2b50d44455e05d566a264dfe8b14edfe8
parent7eb9f3a1a5a4faf7beafd29f0d7fbc76dad5bed4 (diff)
Porting of kfiledialog to qfiledialog
-rw-r--r--src/editor.cpp6
-rw-r--r--src/mainwindow.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/editor.cpp b/src/editor.cpp
index afd35e1..99a56eb 100644
--- a/src/editor.cpp
+++ b/src/editor.cpp
@@ -34,6 +34,7 @@
#include <KMessageBox>
#include <kio/netaccess.h>
+#include <QFileDialog>
static const int CURSOR_WIDTH = 2; // in pixels
@@ -158,9 +159,8 @@ bool Editor::openFile(const QUrl &_url)
QUrl url = _url;
if (maybeSave()) {
if (url.isEmpty()) {
- url = KFileDialog::getOpenUrl(QUrl(),
- QString("*.turtle|%1\n*|%2").arg(i18n("Turtle code files")).arg(i18n("All files")),
- this, i18n("Open"));
+ url = QFileDialog::getOpenFileUrl(this, i18n("Open"), QUrl()),
+ QString("*.turtle|%1\n*|%2").arg(i18n("Turtle code files")).arg(i18n("All files"));
}
if (!url.isEmpty()) {
// if (!KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) {
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f2970a9..80eca29 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -47,6 +47,7 @@
#include <kio/netaccess.h>
#include <knewstuff3/downloaddialog.h>
+#include <QFileDialog>
#include "interpreter/errormsg.h"
#include "interpreter/translator.h"
@@ -1048,7 +1049,7 @@ void MainWindow::exportToSvg()
{
// copied from edit code for file selection
// canvas->saveAsSvg() does not handle QUrl, so only local files are accepted
- QString path = KFileDialog::getSaveFileName(QString(), QString("*.svg|%1\n*|%2").arg(i18n("Scalable Vector Graphics")).arg(i18n("All files")), this, i18n("Save as SVG"));
+ QString path = QFileDialog::getSaveFileName(this, i18n("Save as SVG"), QString(), QString("*.svg|%1\n*|%2").arg(i18n("Scalable Vector Graphics")).arg(i18n("All files")));
if (path.isEmpty())
return;
if (KIO::NetAccess::exists(path, KIO::NetAccess::SourceSide, this) &&
@@ -1064,7 +1065,7 @@ void MainWindow::exportToHtml()
{
// copied from edit code for file selection
// we do not handle QUrl, so only local files are accepted
- QString path = KFileDialog::getSaveFileName(QString(), QString("*.html|%1\n*|%2").arg(i18n("HTML documents")).arg(i18n("All files")), this, i18n("Save code as HTML"));
+ 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 (KIO::NetAccess::exists(path, KIO::NetAccess::SourceSide, this) &&