From c27d8ff5790382daa69829be74457b919ee06cd6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 11 May 2010 11:41:59 +0200 Subject: Load old closed tabs from session manager. This let me think about the need of reimplementing it and all History to support more infos (eg: zoom) closing one bug and opening another :) BUG:228480 --- src/sessionmanager.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src/sessionmanager.cpp') diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp index 0b50791d..6aada509 100644 --- a/src/sessionmanager.cpp +++ b/src/sessionmanager.cpp @@ -106,15 +106,44 @@ bool SessionManager::restoreSession() { line = in.readLine(); kDebug() << "New Window line: " << line; - Application::instance()->loadUrl(line, Rekonq::NewWindow); + Application::instance()->loadUrl( KUrl(line), Rekonq::NewWindow); } else { kDebug() << "New Current Tab line: " << line; - Application::instance()->loadUrl(line, Rekonq::NewCurrentTab); + Application::instance()->loadUrl( KUrl(line), Rekonq::NewCurrentTab); } } while (!line.isEmpty()); return true; } + + +QStringList SessionManager::closedSites() +{ + QStringList list; + + QFile sessionFile(m_sessionFilePath); + if (!sessionFile.exists()) + return list; + if (!sessionFile.open(QFile::ReadOnly)) + { + kDebug() << "Unable to open session file" << sessionFile.fileName(); + return list; + } + + QTextStream in(&sessionFile); + QString line; + do + { + line = in.readLine(); + if (line != QString("window")) + { + list << QString(line); + } + } + while (!line.isEmpty()); + + return list; +} -- cgit v1.2.1