]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/main.cpp
Fix the problem with the column views.
[dolphin.git] / src / main.cpp
index 12eac2211024c5784534cdbd03593c4a36c04539..06dba88a2fc8b5bf77f1272f9658ef000b2f761d 100644 (file)
 
 #include "dolphinapplication.h"
 
+#include "dolphinmainwindow.h"
+
 #include <kaboutdata.h>
 #include <kcmdlineargs.h>
+#include <kicon.h>
 #include <klocale.h>
+#include <kmainwindow.h>
+#include <kdebug.h>
 
 int main(int argc, char **argv)
 {
@@ -33,7 +38,6 @@ int main(int argc, char **argv)
                      KAboutData::License_GPL,
                      ki18nc("@info:credit", "(C) 2006, 2007 Peter Penz"));
     about.setHomepage("http://enzosworld.gmxhome.de");
-    about.setBugAddress("http://bugs.kde.org");
     about.addAuthor(ki18nc("@info:credit", "Peter Penz"),
                     ki18nc("@info:credit", "Maintainer and developer"),
                     "peter.penz@gmx.at");
@@ -45,7 +49,7 @@ int main(int argc, char **argv)
                     "aseigo@kde.org");
     about.addAuthor(ki18nc("@info:credit", "Rafael Fernández López"),
                     ki18nc("@info:credit", "Developer"),
-                    "ereslibre@gmail.com");
+                    "ereslibre@kde.org");
     about.addAuthor(ki18nc("@info:credit", "Kevin Ottens"),
                     ki18nc("@info:credit", "Developer"),
                     "ervin@kde.org");
@@ -70,19 +74,26 @@ int main(int argc, char **argv)
     }
 
     DolphinApplication app;
+    // the .desktop file is not taken into account when launching manually, so
+    // set the icon precautionally:
+    QApplication::setWindowIcon(KIcon("system-file-manager"));
     KGlobal::locale()->insertCatalog("libkonq"); // needed for applications using libkonq
 
-#ifdef __GNUC__
-#warning TODO, SessionManagement
-#endif
-#if 0
-    if (false /* KDE4-TODO: app.isSessionRestored() */) {
+    if (app.isSessionRestored()) {
         int n = 1;
         while (KMainWindow::canBeRestored(n)) {
-            Dolphin::mainWin().restore(n);
+            const QString className = KXmlGuiWindow::classNameOfToplevel(n);
+            if (className == QLatin1String("DolphinMainWindow")) {
+                DolphinMainWindow* win = app.createMainWindow();
+                win->restore(n);
+            } else {
+                kWarning() << "Unknown class " << className << " in session saved data!";
+            }
             ++n;
         }
     } else {
-#endif
-        return app.exec();
+        app.exec();
     }
+
+    return 0;
+}