diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-04-10 00:52:06 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-04-10 00:52:06 +0200 |
commit | 1519d6ab5b9898e1617989719fb31ec5a95c1200 (patch) | |
tree | 9c1bc60c52d2c243889e9d10a950c0c2b8aa50e1 /src/urlbar | |
parent | Use esc button to renew the url seen in the urlbar (diff) | |
download | rekonq-1519d6ab5b9898e1617989719fb31ec5a95c1200.tar.xz |
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.
.
Diffstat (limited to 'src/urlbar')
-rw-r--r-- | src/urlbar/urlresolver.cpp | 57 | ||||
-rw-r--r-- | src/urlbar/urlresolver.h | 2 |
2 files changed, 21 insertions, 38 deletions
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(); +// } diff --git a/src/urlbar/urlresolver.h b/src/urlbar/urlresolver.h index 70549094..030d1deb 100644 --- a/src/urlbar/urlresolver.h +++ b/src/urlbar/urlresolver.h @@ -150,7 +150,7 @@ private: void computeQurlFromUserInput(); void computeBookmarks(); - UrlSearchItem privilegedItem(UrlSearchList* list); +// UrlSearchItem privilegedItem(UrlSearchList* list); UrlSearchList orderLists(); QString _typedString; |