From e74cc60fefbbbe5452c1fa069a59f2cac1ec4c1b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 22 Mar 2007 16:39:43 +0000 Subject: [PATCH] KUniqueApplication::newInstance() already takes care about DBus (thanks to David for the hint). svn path=/trunk/KDE/kdebase/apps/; revision=645447 --- src/main.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 47095c3a5d..b0843a5e7a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,13 +19,10 @@ ***************************************************************************/ #include "dolphinapplication.h" -#include "dolphinmainwindow.h" + #include #include #include -#include -#include -#include static KCmdLineOptions options[] = { @@ -56,10 +53,11 @@ int main(int argc, char **argv) KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions(options); - DolphinApplication* app = 0; - if (DolphinApplication::start()) { - app = new DolphinApplication(); + if (!DolphinApplication::start()) { + return 0; + } + DolphinApplication app; #ifdef __GNUC__ #warning TODO, SessionManagement #endif @@ -72,11 +70,5 @@ int main(int argc, char **argv) } } else { #endif - return app->exec(); - } - - static QDBusInterface dbusIface("org.kde.dolphin", "/dolphin/Application", "", - QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session_bus")); - dbusIface.call("openWindow"); - return 0; + return app.exec(); }