From 3d0017226abe2f2b42787de12fea2ba7cdc668be Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 21 May 2013 09:28:45 +0200 Subject: Move from about: to rekonq: protocol for our special links --- src/urlbar/urlbar.cpp | 16 ++++++++-------- src/urlbar/urlsuggester.cpp | 24 +++++++----------------- 2 files changed, 15 insertions(+), 25 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 6f4a09fc..0c582c42 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -176,7 +176,7 @@ UrlBar::~UrlBar() void UrlBar::setQUrl(const QUrl& url) { - if (url.scheme() == QL1S("about")) + if (url.scheme() == QL1S("rekonq")) return; clearFocus(); @@ -344,7 +344,7 @@ void UrlBar::keyPressEvent(QKeyEvent *event) if (event->key() == Qt::Key_Escape) { clearFocus(); - if (!(_tab->url().protocol() == QL1S("about"))) + if (!(_tab->url().protocol() == QL1S("rekonq"))) setText(_tab->url().prettyUrl()); event->accept(); } @@ -402,7 +402,7 @@ void UrlBar::updateRightIcons() clearRightIcons(); - if (_tab->url().scheme() == QL1S("about")) + if (_tab->url().scheme() == QL1S("rekonq")) { update(); return; @@ -666,7 +666,7 @@ void UrlBar::refreshFavicon() return; } - if (scheme == QL1S("about")) + if (scheme == QL1S("rekonq")) { _icon->setIcon(KIcon("arrow-right")); return; @@ -698,7 +698,7 @@ void UrlBar::delSlot() void UrlBar::manageBookmarks() { - if (_tab->url().scheme() == QL1S("about")) + if (_tab->url().scheme() == QL1S("rekonq")) return; KBookmark bookmark = BookmarkManager::self()->bookmarkForUrl(_tab->url()); @@ -730,7 +730,7 @@ void UrlBar::manageAdBlock(QPoint pos) if (!bt) return; - if (_tab->url().scheme() == QL1S("about")) + if (_tab->url().scheme() == QL1S("rekonq")) return; AdBlockWidget *widget = new AdBlockWidget(_tab->url(), this); @@ -825,7 +825,7 @@ void UrlBar::manageStarred(QPoint pos) void UrlBar::addToFavorites() { - if (_tab->url().scheme() == QL1S("about")) + if (_tab->url().scheme() == QL1S("rekonq")) return; // else, add as favorite @@ -847,7 +847,7 @@ void UrlBar::addToFavorites() void UrlBar::removeFromFavorites() { - if (_tab->url().scheme() == QL1S("about")) + if (_tab->url().scheme() == QL1S("rekonq")) return; QStringList urls = ReKonfig::previewUrls(); diff --git a/src/urlbar/urlsuggester.cpp b/src/urlbar/urlsuggester.cpp index 0a775d85..897b1eb0 100644 --- a/src/urlbar/urlsuggester.cpp +++ b/src/urlbar/urlsuggester.cpp @@ -127,32 +127,22 @@ UrlSuggester::UrlSuggester(const QString &typedUrl) UrlSuggestionList UrlSuggester::orderedSearchItems() { - if (_typedString.startsWith(QL1S("about:"))) + if (_typedString.startsWith(QL1S("rekonq:"))) { 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") + << QL1S("rekonq:home") + << QL1S("rekonq:favorites") + << QL1S("rekonq:bookmarks") + << QL1S("rekonq:history") + << QL1S("rekonq:downloads") + << QL1S("rekonq:closedtabs") ; QStringList aboutUrlResults = aboutUrlList.filter(_typedString, Qt::CaseInsensitive); UrlSuggestionList list; - if (aboutUrlResults.isEmpty()) - { - UrlSuggestionItem info(UrlSuggestionItem::Browse, QL1S("about:info"), QL1S("info")); - list << info; - - return list; - } - Q_FOREACH(const QString & urlResult, aboutUrlResults) { QString name = urlResult; -- cgit v1.2.1