diff options
author | lionelc <lionelc@lionelc.(none)> | 2010-03-30 11:01:44 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-02 22:00:48 +0200 |
commit | 45acb07245d52a51e5b486eaab3c4fdddc2ccbad (patch) | |
tree | 3d73da7c160915f6d1b8bd1dcaa74823b70a849e | |
parent | more gentle autoscroll.. (diff) | |
download | rekonq-45acb07245d52a51e5b486eaab3c4fdddc2ccbad.tar.xz |
display bookmark and history item only if string typed is longer than 3 chars
-rw-r--r-- | src/urlbar/urlresolver.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index cb61ad95..5593f566 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -81,23 +81,26 @@ UrlSearchList UrlResolver::orderedSearchItems() list << qurlFromUserInputResolution(); } - int firstResults = list.count(); - int checkPoint = 9 - firstResults; - - UrlSearchList historyList = historyResolution(); - int historyResults = historyList.count(); - - UrlSearchList bookmarksList = bookmarksResolution(); - int bookmarkResults = bookmarksList.count(); - - if(historyResults + bookmarkResults > checkPoint) + if (_urlString.length()>2) { - historyList = historyList.mid(0,3); - bookmarksList = bookmarksList.mid(0,3); + int firstResults = list.count(); + int checkPoint = 9 - firstResults; + + UrlSearchList historyList = historyResolution(); + int historyResults = historyList.count(); + + UrlSearchList bookmarksList = bookmarksResolution(); + int bookmarkResults = bookmarksList.count(); + + if(historyResults + bookmarkResults > checkPoint) + { + historyList = historyList.mid(0,3); + bookmarksList = bookmarksList.mid(0,3); + } + list << historyList; + list << bookmarksList; } - list << historyList; - list << bookmarksList; - + return list; } |