diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-10-11 12:23:07 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-10-11 12:23:07 +0200 |
commit | ab7a1d8e856894a0074178aee111b4043738d439 (patch) | |
tree | 732390d3b542a53a1c850bb262b077d157b54237 /src/sessionmanager.cpp | |
parent | No need to check progress if load is finished. (diff) | |
parent | ListItem: add auto test for multiple word highlighting. (diff) | |
download | rekonq-ab7a1d8e856894a0074178aee111b4043738d439.tar.xz |
Merge branch 'm213'
Diffstat (limited to 'src/sessionmanager.cpp')
-rw-r--r-- | src/sessionmanager.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index 736dd76c..87f25f43 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -46,7 +46,7 @@ SessionManager::SessionManager(QObject *parent) : QObject(parent) - , m_safe(true) + , m_safe(false) { m_sessionFilePath = KStandardDirs::locateLocal("appdata" , "session"); } @@ -59,12 +59,10 @@ SessionManager::~SessionManager() void SessionManager::saveSession() { - if (!m_safe) + if (!m_safe || QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)) return; m_safe = false; - if( QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled) ) - return; QFile sessionFile(m_sessionFilePath); if (!sessionFile.open(QFile::WriteOnly | QFile::Truncate)) @@ -106,13 +104,19 @@ bool SessionManager::restoreSession() QTextStream in(&sessionFile); QString line; + bool windowAlreadyOpen = Application::instance()->mainWindowList().count(); do { line = in.readLine(); if (line == QL1S("window")) { line = in.readLine(); - Application::instance()->loadUrl( KUrl(line), Rekonq::NewWindow); + if (windowAlreadyOpen) { + Application::instance()->loadUrl( KUrl(line), Rekonq::CurrentTab); + windowAlreadyOpen = false; + } else { + Application::instance()->loadUrl( KUrl(line), Rekonq::NewWindow); + } } else { |