summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-21 00:33:31 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-24 17:21:48 +0200
commit62d1f4f116e8720eff78c384c39e4e84e8a26feb (patch)
treea80062a08c8be6d21b11ebcf0616cf33a4a06738
parentremove domainNameItem() method (diff)
downloadrekonq-62d1f4f116e8720eff78c384c39e4e84e8a26feb.tar.xz
This commit fixes my problems with this new handling.
It searches before in the history, to ensure search is done in the widest site list && change a bit the search mechanism
-rw-r--r--src/urlbar/urlresolver.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index af176a98..c2f1d0ee 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -140,14 +140,14 @@ UrlSearchList UrlResolver::orderedSearchItems()
int firstResults = list.count();
int checkPoint = 9 - firstResults;
- UrlSearchList bookmarksList = bookmarksResolution();
- UrlSearchItem privileged = privilegedItem(&bookmarksList);
- int bookmarkResults = bookmarksList.count();
-
UrlSearchList historyList = historyResolution();
+ UrlSearchItem privileged = privilegedItem(&historyList);
+ int historyResults = historyList.count();
+
+ UrlSearchList bookmarksList = bookmarksResolution();
if (privileged.type == UrlSearchItem::Undefined)
{
- privileged = privilegedItem(&historyList);
+ privileged = privilegedItem(&bookmarksList);
}
if (privileged.type != UrlSearchItem::Undefined)
@@ -155,9 +155,9 @@ UrlSearchList UrlResolver::orderedSearchItems()
list.insert(0,privileged);
}
- int historyResults = historyList.count();
+ int bookmarksResults = bookmarksList.count();
- if (historyResults + bookmarkResults > checkPoint)
+ if (historyResults + bookmarksResults > checkPoint)
{
historyList = historyList.mid(0, 3);
bookmarksList = bookmarksList.mid(0, 3);
@@ -261,7 +261,8 @@ UrlSearchItem UrlResolver::privilegedItem(UrlSearchList* list)
while(i<list->count())
{
UrlSearchItem item = list->at(i);
- if (item.url.url().contains("."+_typedString+".") || item.url.url().contains("/"+_typedString+"."))
+ kDebug() << item.url.host();
+ if (item.url.host().contains( _typedString + QL1C('.') ) )
{
list->removeAt(i);
return item;