From 0d72818e60c9e9f79d0036373bbfbe8d54580890 Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sat, 24 Apr 2010 23:11:34 +0200 Subject: if the url of an item have the same domaine name as the typed string, it is moved at top of the list --- src/urlbar/urlresolver.cpp | 46 +++++++++++++++++++++++++++++++++++++--------- src/urlbar/urlresolver.h | 2 ++ 2 files changed, 39 insertions(+), 9 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 5e055903..e86adc62 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -75,17 +75,21 @@ UrlSearchList UrlResolver::orderedSearchItems() // catch first 3 results from the two resulting lists :) UrlSearchList list; + + if(isHttp()) + { + list << qurlFromUserInputResolution(); + list << webSearchesResolution(); + } + else + { + list << webSearchesResolution(); + list << qurlFromUserInputResolution(); + } -// if(isHttp()) -// { -// list << qurlFromUserInputResolution(); -// } - - list << qurlFromUserInputResolution(); - list << webSearchesResolution(); - + if (_typedString.length() >= 2) - { + { int firstResults = list.count(); int checkPoint = 9 - firstResults; @@ -128,6 +132,8 @@ UrlSearchList UrlResolver::orderedSearchItems() } } + list = placeTypedDomaineNameOnTop(list); + return list; } @@ -215,3 +221,25 @@ UrlSearchList UrlResolver::bookmarksResolution() return list; } + + +UrlSearchList UrlResolver::placeTypedDomaineNameOnTop(UrlSearchList list) +{ + int i=0; + bool found = false; + + while(i