]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/main.cpp
No need to call rowCount() all the time.
[dolphin.git] / src / main.cpp
index 47095c3a5dfee5409a1c1dd0b1d2bfa7c831ad89..b0843a5e7a6206022fa535e37a92b5bf8c980b59 100644 (file)
  ***************************************************************************/
 
 #include "dolphinapplication.h"
-#include "dolphinmainwindow.h"
+
 #include <kaboutdata.h>
 #include <kcmdlineargs.h>
 #include <klocale.h>
-#include <krun.h>
-#include <QDBusInterface>
-#include <QDBusReply>
 
 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();
 }