]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/main.cpp
less KDE 3 dependencies
[dolphin.git] / src / main.cpp
index 9de7b609a4accd9c560eec9c0de94c6835283c81..47095c3a5dfee5409a1c1dd0b1d2bfa7c831ad89 100644 (file)
@@ -33,23 +33,11 @@ static KCmdLineOptions options[] =
     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<int> reply = dbusIface.call("openWindow", url);
-}
-
 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,13 +55,14 @@ int main(int argc, char **argv)
 
     KCmdLineArgs::init(argc, argv, &about);
     KCmdLineArgs::addCmdLineOptions(options);
-    DolphinApplication *app = 0;
+
+    DolphinApplication* app = 0;
     if (DolphinApplication::start()) {
         app = new DolphinApplication();
-    }
-
 
+#ifdef __GNUC__
 #warning TODO, SessionManagement
+#endif
 #if 0
     if (false /* KDE4-TODO: app.isSessionRestored() */) {
         int n = 1;
@@ -83,18 +72,11 @@ int main(int argc, char **argv)
         }
     } 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();
     }
+
+    static QDBusInterface dbusIface("org.kde.dolphin", "/dolphin/Application", "",
+                                    QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session_bus"));
+    dbusIface.call("openWindow");
+    return 0;
 }