diff options
Diffstat (limited to 'src/urlbar/urlresolver.cpp')
-rw-r--r-- | src/urlbar/urlresolver.cpp | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index e86adc62..840fd78f 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -88,50 +88,47 @@ UrlSearchList UrlResolver::orderedSearchItems() } - if (_typedString.length() >= 2) - { - int firstResults = list.count(); - int checkPoint = 9 - firstResults; + int firstResults = list.count(); + int checkPoint = 9 - firstResults; - UrlSearchList historyList = historyResolution(); - int historyResults = historyList.count(); + UrlSearchList historyList = historyResolution(); + int historyResults = historyList.count(); - UrlSearchList bookmarksList = bookmarksResolution(); - int bookmarkResults = bookmarksList.count(); + UrlSearchList bookmarksList = bookmarksResolution(); + int bookmarkResults = bookmarksList.count(); - if (historyResults + bookmarkResults > checkPoint) - { - historyList = historyList.mid(0, 3); - bookmarksList = bookmarksList.mid(0, 3); - } + if (historyResults + bookmarkResults > checkPoint) + { + historyList = historyList.mid(0, 3); + bookmarksList = bookmarksList.mid(0, 3); + } - QList<UrlSearchItem> common; + QList<UrlSearchItem> common; - foreach(UrlSearchItem i, historyList) - { - if (!bookmarksList.contains(i)) - { - list << i; - } - else - { - i.type |= UrlSearchItem::Bookmark; - common << i; - } - } - - foreach(const UrlSearchItem &i, common) + foreach(UrlSearchItem i, historyList) + { + if (!bookmarksList.contains(i)) { list << i; } - - foreach(const UrlSearchItem &i, bookmarksList) + else { - if (!common.contains(i)) - list << i; + i.type |= UrlSearchItem::Bookmark; + common << i; } } + foreach(const UrlSearchItem &i, common) + { + list << i; + } + + foreach(const UrlSearchItem &i, bookmarksList) + { + if (!common.contains(i)) + list << i; + } + list = placeTypedDomaineNameOnTop(list); return list; @@ -225,7 +222,7 @@ UrlSearchList UrlResolver::bookmarksResolution() UrlSearchList UrlResolver::placeTypedDomaineNameOnTop(UrlSearchList list) { - int i=0; + int i = 0; bool found = false; while(i<list.count() && !found) @@ -242,4 +239,3 @@ UrlSearchList UrlResolver::placeTypedDomaineNameOnTop(UrlSearchList list) return list; } - |