From 45acb07245d52a51e5b486eaab3c4fdddc2ccbad Mon Sep 17 00:00:00 2001 From: lionelc Date: Tue, 30 Mar 2010 11:01:44 +0200 Subject: display bookmark and history item only if string typed is longer than 3 chars --- src/urlbar/urlresolver.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'src/urlbar') 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; } -- cgit v1.2.1