From dec19c1e771e216feddbc757ac14f9cb7bd4226a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 16 May 2007 19:37:31 +0000 Subject: [PATCH] fix for the fix for the fix [1]: assure that invoking Dolphin with remote URLs like "dolphin ftp://ftp.kde.org/" works too (thanks to David Faure) [1] I hope this does not get a neverending story ;-) svn path=/trunk/KDE/kdebase/apps/; revision=665393 --- src/dolphinapplication.cpp | 10 +++++----- src/dolphinapplication.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp index 85e27811a..4c3273bff 100644 --- a/src/dolphinapplication.cpp +++ b/src/dolphinapplication.cpp @@ -76,10 +76,10 @@ int DolphinApplication::newInstance() KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); if (args->count() > 0) { for (int i = 0; i < args->count(); ++i) { - openWindow(args->url(i).path()); + openWindow(args->url(i)); } } else { - openWindow(QString()); + openWindow(KUrl()); } args->clear(); @@ -87,11 +87,11 @@ int DolphinApplication::newInstance() return exitValue; } -int DolphinApplication::openWindow(const QString& url) +int DolphinApplication::openWindow(const KUrl& url) { DolphinMainWindow* win = createMainWindow(); - if ((win->activeView() != 0) && !url.isEmpty()) { - win->activeView()->setUrl(KUrl(url)); + if ((win->activeView() != 0) && url.isValid()) { + win->activeView()->setUrl(url); } win->show(); return win->getId(); diff --git a/src/dolphinapplication.h b/src/dolphinapplication.h index 4ea91db83..982873e28 100644 --- a/src/dolphinapplication.h +++ b/src/dolphinapplication.h @@ -25,6 +25,7 @@ #include class DolphinMainWindow; +class KUrl; /** * @brief Holds the application data which can be accessed. @@ -55,7 +56,7 @@ public: virtual int newInstance(); public slots: - int openWindow(const QString& url); + int openWindow(const KUrl& url); protected: /** Called by the DolphinMainWindow to deregister. */ -- 2.47.3