From 1519d6ab5b9898e1617989719fb31ec5a95c1200 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 10 Apr 2011 00:52:06 +0200 Subject: Fix History ordering (check about:history page before and after this patch) and remove the "provileged" item in the urlbar suggestions as it was NOT really working. Reduce min suggestion list from 3 to 2 to enable more history suggestions. . --- src/urlbar/urlresolver.cpp | 57 ++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 37 deletions(-) (limited to 'src/urlbar/urlresolver.cpp') diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index ee01599c..d89f27d0 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -47,7 +47,7 @@ // defines #define MAX_ELEMENTS 8 -#define MIN_SUGGESTIONS 3 +#define MIN_SUGGESTIONS 2 // NOTE // default kurifilter plugin list (at least in my box): @@ -173,26 +173,9 @@ UrlSearchList UrlResolver::orderLists() list << _qurlFromUserInput; } - //find the history items that match the typed string - UrlSearchItem privileged = privilegedItem(&_history); int historyCount = _history.count(); - - //find the bookmarks items that match the typed string - if (privileged.type == UrlSearchItem::Undefined) - { - privileged = privilegedItem(&_bookmarks); - } - else if (privileged.type == UrlSearchItem::History && _bookmarks.removeOne(privileged)) - { - privileged.type |= UrlSearchItem::Bookmark; - } int bookmarksCount = _bookmarks.count(); - if (privileged.type != UrlSearchItem::Undefined) - { - list.prepend(privileged); - } - int availableEntries = MAX_ELEMENTS - list.count() - MIN_SUGGESTIONS; UrlSearchList common; @@ -436,22 +419,22 @@ void UrlResolver::suggestionsReceived(const QString &text, const ResponseList &s } -UrlSearchItem UrlResolver::privilegedItem(UrlSearchList* list) -{ - UrlSearchItem item; - QString dot = QString(QL1C('.')); - QString test1 = QString(QL1C('/')) + _typedString + dot; - QString test2 = dot + _typedString + dot; - - for (int i = 0; i < list->count(); i++) - { - item = list->at(i); - //TODO: move this to AwesomeUrlCompletion::substringCompletion and add a priviledged flag to UrlSearchItem - if (item.url.contains(test1) || item.url.contains(test2)) - { - list->removeAt(i); - return item; - } - } - return UrlSearchItem(); -} +// UrlSearchItem UrlResolver::privilegedItem(UrlSearchList* list) +// { +// UrlSearchItem item; +// QString dot = QString(QL1C('.')); +// QString test1 = QString(QL1C('/')) + _typedString + dot; +// QString test2 = dot + _typedString + dot; +// +// for (int i = 0; i < list->count(); i++) +// { +// item = list->at(i); +// //TODO: move this to AwesomeUrlCompletion::substringCompletion and add a priviledged flag to UrlSearchItem +// if (item.url.contains(test1) || item.url.contains(test2)) +// { +// list->removeAt(i); +// return item; +// } +// } +// return UrlSearchItem(); +// } -- cgit v1.2.1