From 72219b94111542eb45cf8b93ad12c47f1d33aaa8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 27 Sep 2011 13:00:01 +0200 Subject: Fix session manager restore I think we need to consider the two cases (normal restore vs restore from crash) in different ways. --- src/application.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/application.cpp') diff --git a/src/application.cpp b/src/application.cpp index 627536da..985de818 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -223,7 +223,7 @@ int Application::newInstance() loadUrl(KUrl("about:home"), Rekonq::NewWindow); break; case 2: // restore session - if (sessionManager()->restoreSession()) + if (sessionManager()->restoreSessionFromScratch()) { break; } @@ -251,6 +251,11 @@ int Application::newInstance() } } + if (!isRekonqCrashed) + { + sessionManager()->setSessionManagementEnabled(true); + } + if (isFirstLoad) { // give me some time to do the other things.. @@ -275,7 +280,6 @@ void Application::postLaunch() setWindowIcon(KIcon("rekonq")); historyManager(); - sessionManager()->setSessionManagementEnabled(true); // bookmarks loading connect(bookmarkProvider(), SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType&)), @@ -668,7 +672,9 @@ void Application::setPrivateBrowsingMode(bool b) QString text = i18n("%1" "

rekonq will save your current tabs for when you'll stop private browsing the net.

", caption); - int button = KMessageBox::warningContinueCancel(mainWindow(), text, caption, KStandardGuiItem::cont(), KStandardGuiItem::cancel(), i18n("don't ask again")); + int button = KMessageBox::warningContinueCancel(mainWindow(), + text, caption, KStandardGuiItem::cont(), KStandardGuiItem::cancel(), + i18n("don't ask again")); if (button != KMessageBox::Continue) return; @@ -691,8 +697,7 @@ void Application::setPrivateBrowsingMode(bool b) settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false); _privateBrowsingAction->setChecked(false); - loadUrl(KUrl("about:blank"), Rekonq::NewWindow); - if (!sessionManager()->restoreSession()) + if (!sessionManager()->restoreSessionFromScratch()) loadUrl(KUrl("about:home"), Rekonq::NewWindow); } } -- cgit v1.2.1