summaryrefslogtreecommitdiff
path: root/src/urlbar/urlresolver.cpp
diff options
context:
space:
mode:
authorlionelc <lionelc@lionelc.(none)>2010-03-30 19:45:27 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-02 22:01:20 +0200
commita2aa033e21d1746b5479836e8d8363dcb4654d8a (patch)
treefcfd2c3016ecc3fffb38764a4f7737670e1830a0 /src/urlbar/urlresolver.cpp
parentadd title for history items (diff)
downloadrekonq-a2aa033e21d1746b5479836e8d8363dcb4654d8a.tar.xz
manage common item of bookmarks and history
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;