Commit 6e16af8e authored by Lukáš Tinkl's avatar Lukáš Tinkl
Browse files

fix KUrl->QUrl porting bug

both KStandardAction::openRecent and KFileDialog::getOpenUrl take a QUrl
parent cf4c3382
...@@ -171,7 +171,7 @@ void MainWindow::setupActions() ...@@ -171,7 +171,7 @@ void MainWindow::setupActions()
m_openAction = KStandardAction::open(this, SLOT(openArchive()), actionCollection()); m_openAction = KStandardAction::open(this, SLOT(openArchive()), actionCollection());
KStandardAction::quit(this, SLOT(quit()), actionCollection()); KStandardAction::quit(this, SLOT(quit()), actionCollection());
m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openUrl(KUrl)), actionCollection()); m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openUrl(QUrl)), actionCollection());
m_recentFilesAction->setToolBarMode(KRecentFilesAction::MenuMode); m_recentFilesAction->setToolBarMode(KRecentFilesAction::MenuMode);
m_recentFilesAction->setToolButtonPopupMode(QToolButton::DelayedPopup); m_recentFilesAction->setToolButtonPopupMode(QToolButton::DelayedPopup);
m_recentFilesAction->setIconText(i18nc("action, to open an archive", "Open")); m_recentFilesAction->setIconText(i18nc("action, to open an archive", "Open"));
...@@ -223,13 +223,13 @@ void MainWindow::openArchive() ...@@ -223,13 +223,13 @@ void MainWindow::openArchive()
{ {
Interface *iface = qobject_cast<Interface*>(m_part); Interface *iface = qobject_cast<Interface*>(m_part);
Q_ASSERT(iface); Q_ASSERT(iface);
const KUrl url = KFileDialog::getOpenUrl(KUrl("kfiledialog:///ArkOpenDir"), const QUrl url = KFileDialog::getOpenUrl(QUrl("kfiledialog:///ArkOpenDir"),
Kerfuffle::supportedMimeTypes().join( QLatin1String( " " )), Kerfuffle::supportedMimeTypes().join( QLatin1String( " " )),
this); this);
openUrl(url); openUrl(url);
} }
void MainWindow::openUrl(const KUrl& url) void MainWindow::openUrl(const QUrl& url)
{ {
if (!url.isEmpty()) { if (!url.isEmpty()) {
m_part->setArguments(m_openArgs); m_part->setArguments(m_openArgs);
...@@ -265,9 +265,8 @@ void MainWindow::newArchive() ...@@ -265,9 +265,8 @@ void MainWindow::newArchive()
kDebug() << "Supported mimetypes are" << mimeTypes.join( QLatin1String( " " )); kDebug() << "Supported mimetypes are" << mimeTypes.join( QLatin1String( " " ));
const KUrl saveFileUrl = const QUrl saveFileUrl = KFileDialog::getSaveUrl(QUrl("kfiledialog:///ArkNewDir"),
KFileDialog::getSaveUrl(KUrl("kfiledialog:///ArkNewDir"), mimeTypes.join(QLatin1String(" ")));
mimeTypes.join(QLatin1String(" ")));
m_openArgs.metaData()[QLatin1String( "createNewArchive" )] = QLatin1String( "true" ); m_openArgs.metaData()[QLatin1String( "createNewArchive" )] = QLatin1String( "true" );
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <KParts/MainWindow> #include <KParts/MainWindow>
#include <KParts/OpenUrlArguments> #include <KParts/OpenUrlArguments>
#include <KParts/ReadWritePart> #include <KParts/ReadWritePart>
#include <KUrl>
class KRecentFilesAction; class KRecentFilesAction;
...@@ -42,7 +41,7 @@ public: ...@@ -42,7 +41,7 @@ public:
void dragMoveEvent(class QDragMoveEvent * event); void dragMoveEvent(class QDragMoveEvent * event);
public slots: public slots:
void openUrl(const KUrl& url); void openUrl(const QUrl &url);
void setShowExtractDialog(bool); void setShowExtractDialog(bool);
private slots: private slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment