diff options
author | Anton Kreuzkamp <akreuzkamp@web.de> | 2011-08-21 12:01:26 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-08-21 12:01:26 +0200 |
commit | a0315947c024a3be1d35b4700af7fa653272093e (patch) | |
tree | f9a95b5200e144ecb81b50e995fdfc2344dc2482 /src/history | |
parent | Fix saving in adblock management (diff) | |
download | rekonq-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')
-rw-r--r-- | src/history/historymanager.h | 36 |
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; |