From a656e6c5fd5662a3d990115e2b5851570149d594 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 10 Jul 2011 17:21:47 +0200 Subject: WARNING: HISTORY_VERSION upgrade!! This commit changes rekonq history data struct to manage also the first time you visited a site. This way we can "expose" this new info in the SSL widget. (We can obviously do a lot more with it...) --- src/history/historymanager.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/history/historymanager.h') 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; }; -- cgit v1.2.1