summaryrefslogtreecommitdiff
path: root/src/sessionmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-11 11:41:59 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-11 11:41:59 +0200
commitc27d8ff5790382daa69829be74457b919ee06cd6 (patch)
treef225cca68cf60674d7de2b15ea4e8b02d6a7b49a /src/sessionmanager.cpp
parent(Re)-open closed tabs (diff)
downloadrekonq-c27d8ff5790382daa69829be74457b919ee06cd6.tar.xz
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
Diffstat (limited to 'src/sessionmanager.cpp')
-rw-r--r--src/sessionmanager.cpp33
1 files changed, 31 insertions, 2 deletions
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;
+}