┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-09-27 12:36:40 +0000
committerPeter Penz <[email protected]>2007-09-27 12:36:40 +0000
commit384ee037c2f58ca58f3274249f3b44d840af8ef9 (patch)
treee4f52af0c55c001af0b15a929181102b124039b5 /src/main.cpp
parentb45e2e92c568510bf26971ce26157ce2bf6a308d (diff)
reactivate session management
svn path=/trunk/KDE/kdebase/apps/; revision=717737
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 12eac2211..225c48ed6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,9 +20,12 @@
#include "dolphinapplication.h"
+#include "dolphinmainwindow.h"
+
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
+#include <kmainwindow.h>
int main(int argc, char **argv)
{
@@ -72,17 +75,21 @@ int main(int argc, char **argv)
DolphinApplication app;
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;
+}