diff options
Diffstat (limited to 'src/history/historymanager.h')
-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; |