summaryrefslogtreecommitdiff
path: root/src/urlbar/urlresolver.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2011-11-17 00:03:19 +0100
committerYoann Laissus <yoann.laissus@gmail.com>2011-11-17 00:03:19 +0100
commit56450614d5353bdf2615bbd0f44d7c867418ac2d (patch)
tree10289b7d20bc360aa303245c34e5bc363f4636c3 /src/urlbar/urlresolver.cpp
parentfixuifiles (diff)
downloadrekonq-56450614d5353bdf2615bbd0f44d7c867418ac2d.tar.xz
Use the relevance method to sort HistoryItem in the UrlBar
Diffstat (limited to 'src/urlbar/urlresolver.cpp')
-rw-r--r--src/urlbar/urlresolver.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index e7f41c7b..073cc728 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -336,7 +336,7 @@ void UrlResolver::computeWebSearches()
void UrlResolver::computeHistory()
{
QList<HistoryItem> found = rApp->historyManager()->find(_typedString);
- qSort(found);
+ qSort(found.begin(), found.end(), isHistoryItemRelevant);
Q_FOREACH(const HistoryItem & i, found)
{
@@ -391,6 +391,12 @@ void UrlResolver::computeSuggestions()
}
+bool UrlResolver::isHistoryItemRelevant(const HistoryItem &a, const HistoryItem &b)
+{
+ return a.relevance() > b.relevance();
+}
+
+
void UrlResolver::suggestionsReceived(const QString &text, const ResponseList &suggestions)
{
if (text != _typedQuery)