X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/abf17941f7a052d25788d2f2f3c84e5aae935e29..d1aa2eb18029419e280942e91b665438c74c5a1d:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 9de7b609a..98a6a87f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,37 +19,23 @@ ***************************************************************************/ #include "dolphinapplication.h" -#include "dolphinmainwindow.h" + #include #include #include -#include -#include -#include static KCmdLineOptions options[] = -{ - { "+[Url]", I18N_NOOP( "Document to open" ), 0 }, - KCmdLineLastOption -}; - -void openWindow(DolphinApplication* app, const QString& url = QString()) -{ - if (app != 0) { - app->openWindow(url); - return; - } - - static QDBusInterface dbusIface("org.kde.dolphin", "/dolphin/Application", "", - QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session_bus")); - QDBusReply reply = dbusIface.call("openWindow", url); -} + { + { "+[Url]", I18N_NOOP("Document to open"), 0 + }, + KCmdLineLastOption + }; int main(int argc, char **argv) { KAboutData about("dolphin", I18N_NOOP("Dolphin"), - "0.8.0", + "0.9.0", I18N_NOOP("File Manager"), KAboutData::License_GPL, "(C) 2006 Peter Penz"); @@ -67,34 +53,23 @@ 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 - - KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); - if (args->count() > 0) { - for (int i = 0; i < args->count(); ++i) { - openWindow(app, args->arg(i)); - } - } - else { - openWindow(app); - } - args->clear(); - if (app != 0) { - return app->exec(); + return app.exec(); } -}