diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 14 | ||||
-rw-r--r-- | src/main.cpp | 7 | ||||
-rw-r--r-- | src/sessionmanager.cpp | 5 |
3 files changed, 13 insertions, 13 deletions
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 <KAboutData> @@ -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; } |