summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorDavid E. Narváez <david.narvaez@computer.org>2012-01-12 23:11:33 -0500
committerDavid E. Narváez <david.narvaez@computer.org>2012-01-12 23:11:33 -0500
commit7504b595fea9924a4a397cea3dc69fa2e0fd0119 (patch)
tree4de77dab52b76e49c392987645b0214256a2b47d /src/application.cpp
parentrekonq 0.8.58 (diff)
downloadrekonq-7504b595fea9924a4a397cea3dc69fa2e0fd0119.tar.xz
Implement (User) Session Restore
This patch implements session management. Most of the ideas are taken from Konsole, which is also a KUniqueApplication but manages session restoring correctly. REVIEW: 103658
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/application.cpp b/src/application.cpp
index a09fc26e..e868116d 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -183,7 +183,7 @@ int Application::newInstance()
// 2) Are there arguments?
// 3) Is rekonq recovering from crash?
// so, we have 8 possible cases...
- bool isFirstLoad = m_mainWindows.isEmpty();
+ static bool isFirstLoad = true;
bool areThereArguments = (args->count() > 0);
bool isRekonqCrashed = (ReKonfig::recoverOnCrash() > 0);
// note that isRekonqCrashed is always true if it is not the first load
@@ -195,6 +195,13 @@ int Application::newInstance()
int exitValue = 1 * isFirstLoad + 2 * areThereArguments + 4 * isRekonqCrashed;
+ if (isFirstLoad && isSessionRestored())
+ {
+ isFirstLoad = false;
+
+ return exitValue;
+ }
+
if (isRekonqCrashed && isFirstLoad)
{
loadUrl(KUrl("about:closedTabs"), Rekonq::NewWindow);
@@ -312,6 +319,8 @@ int Application::newInstance()
}
KStartupInfo::appStarted();
+ isFirstLoad = false;
+
return exitValue;
}