From f995cf5b90aa6b76de0dce1ba3023dc3989ba90e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 26 Feb 2014 15:27:41 +0100 Subject: [PATCH] use a QFileDialog platform plugin will make it use KFileDialog anyways --- src/shell/interactiveconsole.cpp | 18 +++++++++--------- src/shell/interactiveconsole.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/shell/interactiveconsole.cpp b/src/shell/interactiveconsole.cpp index 25a2a46f9..1f9da92b8 100644 --- a/src/shell/interactiveconsole.cpp +++ b/src/shell/interactiveconsole.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include @@ -293,13 +293,13 @@ void InteractiveConsole::openScriptFile() { delete m_fileDialog; - m_fileDialog = new KFileDialog(QUrl(), QString(), 0); - m_fileDialog->setOperationMode(KFileDialog::Opening); + m_fileDialog = new QFileDialog(); + m_fileDialog->setAcceptMode(QFileDialog::AcceptOpen); m_fileDialog->setWindowTitle(i18n("Open Script File")); QStringList mimetypes; mimetypes << "application/javascript"; - m_fileDialog->setMimeFilter(mimetypes); + m_fileDialog->setMimeTypeFilters(mimetypes); connect(m_fileDialog, SIGNAL(finished(int)), this, SLOT(openScriptUrlSelected(int))); m_fileDialog->show(); @@ -312,7 +312,7 @@ void InteractiveConsole::openScriptUrlSelected(int result) } if (result == QDialog::Accepted) { - const QUrl url = m_fileDialog->selectedUrl(); + const QUrl url = m_fileDialog->selectedUrls().first(); if (!url.isEmpty()) { loadScriptFromUrl(url); } @@ -424,13 +424,13 @@ void InteractiveConsole::saveScript() delete m_fileDialog; - m_fileDialog = new KFileDialog(QUrl(), QString(), 0); - m_fileDialog->setOperationMode(KFileDialog::Saving); + m_fileDialog = new QFileDialog(); + m_fileDialog->setAcceptMode(QFileDialog::AcceptSave); m_fileDialog->setWindowTitle(i18n("Save Script File")); QStringList mimetypes; mimetypes << "application/javascript"; - m_fileDialog->setMimeFilter(mimetypes); + m_fileDialog->setMimeTypeFilters(mimetypes); connect(m_fileDialog, SIGNAL(finished(int)), this, SLOT(saveScriptUrlSelected(int))); m_fileDialog->show(); @@ -443,7 +443,7 @@ void InteractiveConsole::saveScriptUrlSelected(int result) } if (result == QDialog::Accepted) { - const QUrl url = m_fileDialog->selectedUrl(); + const QUrl url = m_fileDialog->selectedUrls().first(); if (!url.isEmpty()) { saveScript(url); } diff --git a/src/shell/interactiveconsole.h b/src/shell/interactiveconsole.h index 39fbc3d56..0775ac67e 100644 --- a/src/shell/interactiveconsole.h +++ b/src/shell/interactiveconsole.h @@ -30,7 +30,7 @@ class QSplitter; class QAction; -class KFileDialog; +class QFileDialog; class QMenu; class KTextEdit; class KTextBrowser; @@ -105,7 +105,7 @@ private: QAction *m_kwinAction; QMenu *m_snippetsMenu; - KFileDialog *m_fileDialog; + QFileDialog *m_fileDialog; QWeakPointer m_job; bool m_closeWhenCompleted; ConsoleMode m_mode;