From 8d189f44c4d1bf3bea71da43fef59cb772a348bc Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 26 Jul 2008 19:09:17 +0000 Subject: [PATCH] use DBus interface instead of KRun::runCommand() svn path=/trunk/KDE/kdebase/apps/; revision=838112 --- src/dolphinmainwindow.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 3c52e2c71..e14cb1c2d 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -75,6 +75,7 @@ #include #include +#include #include #include #include @@ -634,14 +635,11 @@ void DolphinMainWindow::quickView() const KUrl::List urls = activeViewContainer()->view()->selectedUrls(); Q_ASSERT(urls.count() > 0); - // TODO: this is a quick hack - use QDBus interface directly in future - const QString command = "qdbus org.kde.plasma /Previewer org.kde.Previewer.openFile"; + QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.plasma", "/Previewer", "", "openFile"); foreach (const KUrl& url, urls) { - QString openUrlCommand = command; - openUrlCommand.append(" \""); - openUrlCommand.append(url.prettyUrl()); - openUrlCommand.append('"'); - KRun::runCommand(openUrlCommand, 0, 0, this); + QList args; + msg.setArguments(QList() << url.prettyUrl()); + QDBusConnection::sessionBus().send(msg); } } -- 2.47.3