diff options
Diffstat (limited to 'src/history/historymanager.h')
-rw-r--r-- | src/history/historymanager.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/history/historymanager.h b/src/history/historymanager.h index e22b7042..101bc09d 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -65,7 +65,8 @@ public: ) : title(t) , url(u) - , dateTime(d) + , firstDateTimeVisit(d) + , lastDateTimeVisit(d) , visitCount(1) {} @@ -73,23 +74,25 @@ public: { return other.title == title && other.url == url - && other.dateTime == dateTime; + && other.firstDateTimeVisit == firstDateTimeVisit + && other.lastDateTimeVisit == lastDateTimeVisit; } inline qreal relevance() const { - return log(visitCount) - log(dateTime.daysTo(QDateTime::currentDateTime()) + 1); + return log(visitCount) - log(lastDateTimeVisit.daysTo(QDateTime::currentDateTime()) + 1); } // history is sorted in reverse inline bool operator <(const HistoryItem &other) const { - return dateTime > other.dateTime; + return lastDateTimeVisit > other.lastDateTimeVisit; } QString title; QString url; - QDateTime dateTime; + QDateTime firstDateTimeVisit; + QDateTime lastDateTimeVisit; int visitCount; }; |