summaryrefslogtreecommitdiff
path: root/src/history/historymanager.h
diff options
context:
space:
mode:
authorAnton Kreuzkamp <akreuzkamp@web.de>2011-08-21 12:01:26 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-08-21 12:01:26 +0200
commita0315947c024a3be1d35b4700af7fa653272093e (patch)
treef9a95b5200e144ecb81b50e995fdfc2344dc2482 /src/history/historymanager.h
parentFix saving in adblock management (diff)
downloadrekonq-a0315947c024a3be1d35b4700af7fa653272093e.tar.xz
Restore tab's history when restoring a tab/session
We finally have it :D CCMAIL: akreuzkamp@web.de REVIEW: 100604 REVIEWED-BY: adjam, elproxy
Diffstat (limited to 'src/history/historymanager.h')
-rw-r--r--src/history/historymanager.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/history/historymanager.h b/src/history/historymanager.h
index 101bc09d..bdce16d7 100644
--- a/src/history/historymanager.h
+++ b/src/history/historymanager.h
@@ -46,6 +46,7 @@
#include <QTimer>
#include <QSortFilterProxyModel>
#include <QWebHistoryInterface>
+#include <QWebHistory>
#include <math.h>
@@ -99,6 +100,41 @@ public:
// ---------------------------------------------------------------------------------------------------------------
+class TabHistory
+{
+public:
+ explicit TabHistory(QWebHistory *h = 0)
+ {
+ if (h)
+ {
+ title = h->currentItem().title();
+ url = h->currentItem().url().toString();
+ QDataStream stream(&history, QIODevice::ReadWrite);
+ stream << *h;
+ }
+ }
+
+ inline bool operator ==(const TabHistory &other) const
+ {
+ return history == other.history;
+ }
+
+ void applyHistory(QWebHistory *h)
+ {
+ if (h)
+ {
+ QDataStream stream(&history, QIODevice::ReadOnly);
+ stream >> *h;
+ }
+ }
+
+ QString title;
+ QString url;
+ QByteArray history;
+};
+
+// ---------------------------------------------------------------------------------------------------------------
+
// Forward Declarations
class AutoSaver;