summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-09-27 13:00:01 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-09-27 13:00:01 +0200
commit72219b94111542eb45cf8b93ad12c47f1d33aaa8 (patch)
treec2311b6a1272a3878febe06e448bc06d77633704 /src/application.cpp
parentCalm down QWidget::setLayout() warnings (diff)
downloadrekonq-72219b94111542eb45cf8b93ad12c47f1d33aaa8.tar.xz
Fix session manager restore
I think we need to consider the two cases (normal restore vs restore from crash) in different ways.
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp15
1 files changed, 10 insertions, 5 deletions
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("<b>%1</b>"
"<p>rekonq will save your current tabs for when you'll stop private browsing the net.</p>", 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);
}
}