summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-05-04 11:06:46 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-05-15 09:53:42 +0200
commitceb90314fe93b93e9c025045f0b22db896204a81 (patch)
treed39e25f3101891449a3d81d700d5b7baf55099ff /src/urlbar
parentSVN_SILENT made messages (.desktop file) (diff)
downloadrekonq-ceb90314fe93b93e9c025045f0b22db896204a81.tar.xz
Improve about url resolving
Conflicts: src/urlbar/urlresolver.cpp
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/urlresolver.cpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp
index 833a48f9..f7fb27f1 100644
--- a/src/urlbar/urlresolver.cpp
+++ b/src/urlbar/urlresolver.cpp
@@ -120,21 +120,36 @@ UrlSearchList UrlResolver::orderedSearchItems()
{
if (_typedString.startsWith(QL1S("about:")))
{
+ QStringList aboutUrlList;
+ aboutUrlList
+ << QL1S("about:home")
+ << QL1S("about:favorites")
+ << QL1S("about:closedTabs")
+ << QL1S("about:bookmarks")
+ << QL1S("about:history")
+ << QL1S("about:downloads")
+ << QL1S("about:tabs")
+ << QL1S("about:info");
+
+ QStringList aboutUrlResults = aboutUrlList.filter(_typedString, Qt::CaseInsensitive);
+
UrlSearchList list;
- UrlSearchItem home(UrlSearchItem::Browse, QL1S("about:home"), QL1S("home"));
- list << home;
- UrlSearchItem favs(UrlSearchItem::Browse, QL1S("about:favorites"), QL1S("favorites"));
- list << favs;
- UrlSearchItem clos(UrlSearchItem::Browse, QL1S("about:closedTabs"), QL1S("closed tabs"));
- list << clos;
- UrlSearchItem book(UrlSearchItem::Browse, QL1S("about:bookmarks"), QL1S("bookmarks"));
- list << book;
- UrlSearchItem hist(UrlSearchItem::Browse, QL1S("about:history"), QL1S("history"));
- list << hist;
- UrlSearchItem down(UrlSearchItem::Browse, QL1S("about:downloads"), QL1S("downloads"));
- list << down;
- UrlSearchItem tabs(UrlSearchItem::Browse, QL1S("about:tabs"), QL1S("tabs"));
- list << tabs;
+
+ if (aboutUrlResults.isEmpty())
+ {
+ UrlSearchItem info(UrlSearchItem::Browse, QL1S("about:info"), QL1S("info"));
+ list << info;
+
+ return list;
+ }
+
+ Q_FOREACH(const QString & urlResult, aboutUrlResults)
+ {
+ QString name = urlResult;
+ name.remove(0,6);
+ UrlSearchItem item(UrlSearchItem::Browse, urlResult, name);
+ list << item;
+ }
return list;
}