From 4757621b22d86b15d26983ff896ad21a0941c2d7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 13 Sep 2009 03:57:58 +0200 Subject: Fixing session manager behaviour following a bit dolphin's code --- src/application.cpp | 14 ++++++-------- src/main.cpp | 7 +++++++ src/sessionmanager.cpp | 5 ----- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 1e30cfd0..88eb3c58 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -84,11 +84,6 @@ Application::~Application() int Application::newInstance() { - if( isSessionRestored() && sessionManager()->restoreSession() ) - { - return 1; - } - KCmdLineArgs::setCwd(QDir::currentPath().toUtf8()); KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); @@ -120,9 +115,12 @@ int Application::newInstance() } else { - // creating new window - MainWindow *w = newMainWindow(); - w->slotHome(); + if(!sessionRestored()) + { + // creating new window + MainWindow *w = newMainWindow(); + w->slotHome(); + } } return 0; diff --git a/src/main.cpp b/src/main.cpp index fe8ce0eb..e97f2502 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ // Local Includes #include "application.h" +#include "sessionmanager.h" // KDE Includes #include @@ -127,5 +128,11 @@ int main(int argc, char **argv) } Application app; + + if( app.isSessionRestored() ) + { + Application::sessionManager()->restoreSession(); + } + return app.exec(); } diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index 34466e6e..c93a229d 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -53,9 +53,6 @@ SessionManager::SessionManager(QObject *parent) SessionManager::~SessionManager() { - // rekonq is closing well. no need for session file - QFile sessionFile(m_sessionFilePath); - sessionFile.remove(); } @@ -110,7 +107,5 @@ bool SessionManager::restoreSession() } } - // session is restored. remove session file. - sessionFile.remove(); return true; } -- cgit v1.2.1