X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6ee9f08e8fc90cc67cd2ed83ae6f2dd5c1846ba3..2060fa8d4676fb2d5116830c304db8fdb556d959:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 47095c3a5..98a6a87f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,19 +19,17 @@ ***************************************************************************/ #include "dolphinapplication.h" -#include "dolphinmainwindow.h" + #include #include #include -#include -#include -#include static KCmdLineOptions options[] = -{ - { "+[Url]", I18N_NOOP( "Document to open" ), 0 }, - KCmdLineLastOption -}; + { + { "+[Url]", I18N_NOOP("Document to open"), 0 + }, + KCmdLineLastOption + }; int main(int argc, char **argv) { @@ -56,27 +54,22 @@ 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 #if 0 if (false /* KDE4-TODO: app.isSessionRestored() */) { int n = 1; - while (KMainWindow::canBeRestored(n)){ + while (KMainWindow::canBeRestored(n)) { Dolphin::mainWin().restore(n); ++n; } } else { #endif - return app->exec(); + return app.exec(); } - - static QDBusInterface dbusIface("org.kde.dolphin", "/dolphin/Application", "", - QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session_bus")); - dbusIface.call("openWindow"); - return 0; -}