summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-08 19:41:55 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit43b0121f717dda8a1f179fb585a3c78e3552430c (patch)
tree60b7132e4440685d7e905fae8afc7df447993748 /src/application.cpp
parentSaving the "pinned" state in the sessionmanager (diff)
downloadrekonq-43b0121f717dda8a1f179fb585a3c78e3552430c.tar.xz
Restoring pinned tabs, yeah!!!! :D
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 831df323..4f6f9651 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -135,9 +135,19 @@ int Application::newInstance()
}
}
- if (isFirstLoad && (ReKonfig::startupBehaviour() == 2) && SessionManager::self()->restoreSessionFromScratch())
+ if (isFirstLoad)
{
- isFirstLoad = false;
+ bool restoreOk = false;
+ if (ReKonfig::startupBehaviour() == 2)
+ {
+ restoreOk = SessionManager::self()->restoreSessionFromScratch();
+ }
+ else
+ {
+ restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
+ }
+
+ isFirstLoad = restoreOk;
}
// first argument: 99% of the time we have just that...
@@ -183,13 +193,22 @@ int Application::newInstance()
// if NOT is Session restored...
if (!isSessionRestored())
{
+ bool restoreOk = false;
switch (ReKonfig::startupBehaviour())
{
case 0: // open home page
- loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewWindow);
+ restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
+ if (restoreOk)
+ loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewTab);
+ else
+ loadUrl(KUrl(ReKonfig::homePage()) , Rekonq::NewWindow);
break;
case 1: // open new tab page
- loadUrl(KUrl("about:home"), Rekonq::NewWindow);
+ restoreOk = SessionManager::self()->restoreJustThePinnedTabs();
+ if (restoreOk)
+ loadUrl(KUrl("about:home"), Rekonq::NewTab);
+ else
+ loadUrl(KUrl("about:home"), Rekonq::NewWindow);
break;
case 2: // restore session
if (SessionManager::self()->restoreSessionFromScratch())