diff options
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 { |