summaryrefslogtreecommitdiff
path: root/src/urlbar/urlresolver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/urlbar/urlresolver.cpp')
-rw-r--r--src/urlbar/urlresolver.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index 3877a6c2..ef071c30 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -53,6 +53,10 @@
// 4 ."kuriikwsfilter"
// 5. "fixhosturifilter"
+bool UrlSearchItem::operator==(UrlSearchItem i)
+{
+ return url==i.url;
+}
UrlResolver::UrlResolver(const QString &typedUrl)
: _urlString(typedUrl)
@@ -97,8 +101,27 @@ UrlSearchList UrlResolver::orderedSearchItems()
historyList = historyList.mid(0,3);
bookmarksList = bookmarksList.mid(0,3);
}
- list << historyList;
- list << bookmarksList;
+
+ QList<UrlSearchItem> common;
+
+ foreach (UrlSearchItem i, historyList)
+ {
+ if (!bookmarksList.contains(i))
+ list << i;
+ else
+ common << i;
+ }
+
+ foreach (UrlSearchItem i, common)
+ {
+ list << i;
+ }
+
+ foreach (UrlSearchItem i, bookmarksList)
+ {
+ if (!common.contains(i))
+ list << i;
+ }
}
return list;