summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-04-24 10:37:41 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-04-24 10:37:41 +0200
commit1054e2ea8b5ad17ca719a1fee10832709f1c2418 (patch)
tree2966f37b5d7182c3fcd3fa81544a82c11bb5c7e3
parentrekonq 0.9.57 (diff)
downloadrekonq-1054e2ea8b5ad17ca719a1fee10832709f1c2418.tar.xz
Do not show "closed tabs" page after crash when directly opening an URL
BUG: 283178
-rw-r--r--src/application.cpp49
-rw-r--r--src/sessionmanager.cpp3
2 files changed, 28 insertions, 24 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 0dea1296..27a6490c 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -203,12 +203,6 @@ int Application::newInstance()
return 0;
}
- if (isFirstLoad && isRekonqCrashed)
- {
- loadUrl(KUrl("about:closedTabs"), Rekonq::NewWindow);
- QTimer::singleShot(1000, mainWindow()->currentTab(), SLOT(showMessageBar()));
- }
-
if (areThereArguments)
{
// prepare URLS to load
@@ -271,28 +265,34 @@ int Application::newInstance()
}
else
{
- // we are starting rekonq, for the first time with no args: use startup behaviour
- if (isFirstLoad && !isRekonqCrashed)
+ if (isFirstLoad)
{
- switch (ReKonfig::startupBehaviour())
+ if (isRekonqCrashed)
{
- case 0: // open home page
- newMainWindow()->homePage();
- break;
- case 1: // open new tab page
- loadUrl(KUrl("about:home"), Rekonq::NewWindow);
- break;
- case 2: // restore session
- if (sessionManager()->restoreSessionFromScratch())
+ loadUrl(KUrl("about:closedTabs"), Rekonq::NewWindow);
+ }
+ else
+ {
+ switch (ReKonfig::startupBehaviour())
{
+ case 0: // open home page
+ newMainWindow()->homePage();
+ break;
+ case 1: // open new tab page
+ loadUrl(KUrl("about:home"), Rekonq::NewWindow);
+ break;
+ case 2: // restore session
+ if (sessionManager()->restoreSessionFromScratch())
+ {
+ break;
+ }
+ default:
+ newMainWindow()->homePage();
break;
}
- default:
- newMainWindow()->homePage();
- break;
}
}
- else if (!isFirstLoad) // rekonq has just been started. Just open a new window
+ else
{
switch (ReKonfig::newTabsBehaviour())
{
@@ -307,11 +307,14 @@ int Application::newInstance()
loadUrl(KUrl("about:blank") , Rekonq::NewWindow);
break;
}
-
}
}
- if (!isRekonqCrashed)
+ if (isRekonqCrashed)
+ {
+ QTimer::singleShot(1000, mainWindow()->currentTab(), SLOT(showMessageBar()));
+ }
+ else
{
sessionManager()->setSessionManagementEnabled(true);
}
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 02488801..d5bc1ff8 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -208,7 +208,8 @@ void SessionManager::restoreCrashedSession()
MainView *mv = (winNo == 0) ? rApp->mainWindow()->mainView() : rApp->newMainWindow()->mainView();
- int currentTab = loadViewTabs(mv, window, true);
+ bool useCurrentTab = (mv->currentWebTab()->url().protocol() == QL1S("about"));
+ int currentTab = loadViewTabs(mv, window, useCurrentTab);
mv->setCurrentIndex(currentTab);
}