summaryrefslogtreecommitdiff
path: root/src/history
diff options
context:
space:
mode:
Diffstat (limited to 'src/history')
-rw-r--r--src/history/historymanager.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/history/historymanager.h b/src/history/historymanager.h
index a4099de7..60598ce5 100644
--- a/src/history/historymanager.h
+++ b/src/history/historymanager.h
@@ -47,6 +47,7 @@
#include <QSortFilterProxyModel>
#include <QWebHistoryInterface>
+#include <math.h>
/**
* Elements in this class represent an history item
@@ -73,10 +74,15 @@ public:
&& other.dateTime == dateTime;
}
+ inline qreal relevance() const
+ {
+ return log(visitCount) - log(dateTime.daysTo(QDateTime::currentDateTime()) + 1);
+ }
+
// history is sorted in reverse
inline bool operator <(const HistoryItem &other) const
{
- return dateTime > other.dateTime;
+ return relevance() > other.relevance();
}
QString title;