diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-07-22 01:00:40 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-07-22 01:00:40 +0200 |
commit | bbab050a3b1c6a631aed8fdf5b0ab484378e0cef (patch) | |
tree | 10798d78258216ebdfabc8ba6c04b8034dc9dd4e /src/history/historymanager.h | |
parent | Merge commit 'refs/merge-requests/152' of git://gitorious.org/rekonq/mainline (diff) | |
parent | fix suggestion type (diff) | |
download | rekonq-bbab050a3b1c6a631aed8fdf5b0ab484378e0cef.tar.xz |
Merge commit 'refs/merge-requests/153' of git://gitorious.org/rekonq/mainline into m153
Conflicts:
src/history/historymanager.cpp
src/history/historymanager.h
Diffstat (limited to 'src/history/historymanager.h')
-rw-r--r-- | src/history/historymanager.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/src/history/historymanager.h b/src/history/historymanager.h index ce712919..85702b84 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -84,6 +84,32 @@ public: // --------------------------------------------------------------------------------------------------------------- +class HistoryHashItem : public HistoryItem +{ +public: + HistoryHashItem() {} + explicit HistoryHashItem(const QString &u + ,const QDateTime &d = QDateTime() + ,const QString &t = QString() + ) + : HistoryItem(u, d, t) + ,visitCount(1) + ,savedCount(0) + {} + + inline bool operator <(const HistoryHashItem &other) const + { + return visitCount > other.visitCount; + } + + int visitCount; + int savedCount; +}; + + +// --------------------------------------------------------------------------------------------------------------- + + // Forward Declarations class AutoSaver; class HistoryModel; @@ -115,7 +141,8 @@ public: void updateHistoryEntry(const KUrl &url, const QString &title); void removeHistoryEntry(const KUrl &url, const QString &title = QString()); - QString titleForHistoryUrl(const QString &url); + HistoryHashItem get(const QString &url); + QList<HistoryHashItem> find(const QString &text); int historyLimit() const; void setHistoryLimit(int limit); @@ -128,11 +155,6 @@ public: HistoryFilterModel *historyFilterModel() const; HistoryTreeModel *historyTreeModel() const; - /** - * @returns the AwesomeUrlCompletion object. - */ - AwesomeUrlCompletion *completionObject() const; - public slots: void clear(); void loadSettings(); @@ -142,20 +164,19 @@ private slots: void checkForExpired(); private: + void addHistoryHashEntry(const HistoryItem &item); void load(); AutoSaver *m_saveTimer; int m_historyLimit; QTimer m_expiredTimer; QList<HistoryItem> m_history; + QHash<QString, HistoryHashItem> m_hash; QString m_lastSavedUrl; HistoryModel *m_historyModel; HistoryFilterModel *m_historyFilterModel; HistoryTreeModel *m_historyTreeModel; - - // the completion object we sync with - AwesomeUrlCompletion *m_completion; }; |