summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-05-21 09:28:45 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-06-06 23:48:27 +0200
commit3d0017226abe2f2b42787de12fea2ba7cdc668be (patch)
treea7bfdf7fd156f127945a8b491d47aa38c0e3c75f
parentUse webkit general font to render rekonq pages (diff)
downloadrekonq-3d0017226abe2f2b42787de12fea2ba7cdc668be.tar.xz
Move from about: to rekonq: protocol for our special links
-rw-r--r--src/application.cpp20
-rw-r--r--src/data/home.html2
-rw-r--r--src/history/historymanager.cpp4
-rw-r--r--src/icons/iconmanager.cpp31
-rw-r--r--src/rekonqpage/newtabpage.cpp104
-rw-r--r--src/rekonqpage/newtabpage.h4
-rw-r--r--src/sessionmanager.cpp2
-rw-r--r--src/tabwindow/tabwidget.cpp10
-rw-r--r--src/urlbar/urlbar.cpp16
-rw-r--r--src/urlbar/urlsuggester.cpp24
-rw-r--r--src/webtab/previewselectorbar.cpp4
-rw-r--r--src/webtab/protocolhandler.cpp24
-rw-r--r--src/webtab/webpage.cpp2
-rw-r--r--src/webtab/webtab.cpp2
-rw-r--r--src/webwindow/webwindow.cpp10
15 files changed, 119 insertions, 140 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 7fdf006c..34bf3370 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -284,23 +284,23 @@ int Application::newInstance()
case 1: // open new tab page
if (incognito)
{
- loadUrl(KUrl("about:home"), Rekonq::NewPrivateWindow);
+ loadUrl(KUrl("rekonq:home"), Rekonq::NewPrivateWindow);
break;
}
if (SessionManager::self()->restoreJustThePinnedTabs())
- loadUrl(KUrl("about:home") , Rekonq::NewTab);
+ loadUrl(KUrl("rekonq:home") , Rekonq::NewTab);
else
- loadUrl(KUrl("about:home"), Rekonq::NewWindow);
+ loadUrl(KUrl("rekonq:home"), Rekonq::NewWindow);
break;
case 2: // restore session
if (incognito)
{
- loadUrl(KUrl("about:home"), Rekonq::NewPrivateWindow);
+ loadUrl(KUrl("rekonq:home"), Rekonq::NewPrivateWindow);
break;
}
if (hasToBeRecoveredFromCrash || !SessionManager::self()->restoreSessionFromScratch())
{
- loadUrl(KUrl("about:home") , Rekonq::NewTab);
+ loadUrl(KUrl("rekonq:home") , Rekonq::NewTab);
}
break;
case 3:
@@ -319,7 +319,7 @@ int Application::newInstance()
switch (ReKonfig::newTabsBehaviour())
{
case 0: // new tab page
- loadUrl(KUrl("about:home") , type);
+ loadUrl(KUrl("rekonq:home") , type);
break;
case 2: // homepage
loadUrl(KUrl(ReKonfig::homePage()) , type);
@@ -569,8 +569,8 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type)
}
Rekonq::OpenType newType = type;
- // Don't open useless tabs or windows for actions in about: pages
- if (url.url().contains("about:") && url.url().contains("/"))
+ // Don't open useless tabs or windows for actions in rekonq: pages
+ if (url.url().contains("rekonq:") && url.url().contains("/"))
newType = Rekonq::CurrentTab;
RekonqWindow *w = 0;
@@ -965,8 +965,8 @@ void Application::bookmarksToolbarToggled(bool b)
void Application::newPrivateBrowsingWindow()
{
- // NOTE: what about an "about:incognito" page?
- loadUrl(KUrl("about:home"), Rekonq::NewPrivateWindow);
+ // NOTE: what about a "rekonq:incognito" page?
+ loadUrl(KUrl("rekonq:home"), Rekonq::NewPrivateWindow);
}
diff --git a/src/data/home.html b/src/data/home.html
index 428030c6..70c2c5d7 100644
--- a/src/data/home.html
+++ b/src/data/home.html
@@ -156,7 +156,7 @@ input {
/* -------------------------------------------------------- */
/* Previews */
-#content.favorites, #content.closedTabs, #content.bookmarks {
+#content.favorites, #content.closedtabs, #content.bookmarks {
text-align: center;
}
diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp
index 2fab9cf1..858d441f 100644
--- a/src/history/historymanager.cpp
+++ b/src/history/historymanager.cpp
@@ -132,8 +132,8 @@ void HistoryManager::addHistoryEntry(const KUrl &url, const QString &title)
QUrl urlToClean(url);
- // don't store about: urls (home page related)
- if (urlToClean.scheme() == QString("about"))
+ // don't store rekonq: urls (home page related)
+ if (urlToClean.scheme() == QString("rekonq"))
return;
urlToClean.setPassword(QString());
diff --git a/src/icons/iconmanager.cpp b/src/icons/iconmanager.cpp
index c8775ed3..d0222bed 100644
--- a/src/icons/iconmanager.cpp
+++ b/src/icons/iconmanager.cpp
@@ -79,19 +79,19 @@ KIcon IconManager::iconForUrl(const KUrl &url)
QByteArray encodedUrl = url.toEncoded();
// rekonq icons..
- if (encodedUrl == QByteArray("about:home"))
+ if (encodedUrl == QByteArray("rekonq:home"))
return KIcon("go-home");
- if (encodedUrl == QByteArray("about:closedTabs"))
+ if (encodedUrl == QByteArray("rekonq:closedtabs"))
return KIcon("tab-close");
- if (encodedUrl == QByteArray("about:history"))
+ if (encodedUrl == QByteArray("rekonq:history"))
return KIcon("view-history");
- if (encodedUrl == QByteArray("about:bookmarks"))
+ if (encodedUrl == QByteArray("rekonq:bookmarks"))
return KIcon("bookmarks");
- if (encodedUrl == QByteArray("about:favorites"))
+ if (encodedUrl == QByteArray("rekonq:favorites"))
return KIcon("emblem-favorite");
- if (encodedUrl == QByteArray("about:downloads"))
+ if (encodedUrl == QByteArray("rekonq:downloads"))
return KIcon("download");
- if (encodedUrl == QByteArray("about:tabs"))
+ if (encodedUrl == QByteArray("rekonq:tabs"))
return KIcon("tab-duplicate");
// TODO: return other mimetype icons
@@ -200,41 +200,36 @@ QString IconManager::iconPathForUrl(const KUrl &url)
QByteArray encodedUrl = url.toEncoded();
// rekonq icons..
- if (encodedUrl == QByteArray("about:home"))
+ if (encodedUrl == QByteArray("rekonq:home"))
{
QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/actions/go-home.png");
return icon;
}
- if (encodedUrl == QByteArray("about:closedTabs"))
+ if (encodedUrl == QByteArray("rekonq:closedtabs"))
{
QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/actions/tab-close.png");
return icon;
}
- if (encodedUrl == QByteArray("about:history"))
+ if (encodedUrl == QByteArray("rekonq:history"))
{
QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/actions/view-history.png");
return icon;
}
- if (encodedUrl == QByteArray("about:bookmarks"))
+ if (encodedUrl == QByteArray("rekonq:bookmarks"))
{
QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/places/bookmarks.png");
return icon;
}
- if (encodedUrl == QByteArray("about:favorites"))
+ if (encodedUrl == QByteArray("rekonq:favorites"))
{
QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/emblems/emblem-favorite.png");
return icon;
}
- if (encodedUrl == QByteArray("about:downloads"))
+ if (encodedUrl == QByteArray("rekonq:downloads"))
{
QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/actions/download.png");
return icon;
}
- if (encodedUrl == QByteArray("about:tabs"))
- {
- QString icon = QL1S("file://") + KGlobal::dirs()->findResource("icon", "oxygen/16x16/actions/tab-duplicate.png");
- return icon;
- }
// TODO: return other mimetype icons
if (url.isLocalFile())
diff --git a/src/rekonqpage/newtabpage.cpp b/src/rekonqpage/newtabpage.cpp
index 7857b7d9..58451d17 100644
--- a/src/rekonqpage/newtabpage.cpp
+++ b/src/rekonqpage/newtabpage.cpp
@@ -98,8 +98,8 @@ void NewTabPage::generate(const KUrl &url)
WebView *view = qobject_cast<WebView *>(pg->parent());
WebTab *tab = view->parentTab();
- // about:preview links
- if (KUrl("about:settings").isParentOf(url))
+ // rekonq:preview links
+ if (KUrl("rekonq:settings").isParentOf(url))
{
if (url.fileName() == QL1S("network"))
{
@@ -132,8 +132,8 @@ void NewTabPage::generate(const KUrl &url)
}
}
- // about:preview links
- if (KUrl("about:preview").isParentOf(url))
+ // rekonq:preview links
+ if (KUrl("rekonq:preview").isParentOf(url))
{
if (url.fileName() == QL1S("add"))
{
@@ -148,7 +148,7 @@ void NewTabPage::generate(const KUrl &url)
ReKonfig::setPreviewNames(names);
ReKonfig::setPreviewUrls(urls);
- loadPageForUrl(KUrl("about:favorites"));
+ loadPageForUrl(KUrl("rekonq:favorites"));
tab->createPreviewSelectorBar(index);
return;
@@ -176,8 +176,8 @@ void NewTabPage::generate(const KUrl &url)
}
}
- // about:closedTabs links
- if (KUrl("about:closedTabs").isParentOf(url))
+ // rekonq:closedtabs links
+ if (KUrl("rekonq:closedtabs").isParentOf(url))
{
if (url.fileName() == QL1S("restore"))
{
@@ -188,27 +188,27 @@ void NewTabPage::generate(const KUrl &url)
}
}
- // about:history links
- if (KUrl("about:history").isParentOf(url))
+ // rekonq:history links
+ if (KUrl("rekonq:history").isParentOf(url))
{
if (url.fileName() == QL1S("clear"))
{
HistoryManager::self()->clear();
- loadPageForUrl(KUrl("about:history"));
+ loadPageForUrl(KUrl("rekonq:history"));
return;
}
if (url.fileName() == QL1S("showAllItems"))
{
m_showFullHistory = true;
- loadPageForUrl(KUrl("about:history"));
+ loadPageForUrl(KUrl("rekonq:history"));
return;
}
if (url.fileName() == QL1S("search"))
{
QString value = url.queryItemValue(QL1S("q"));
- loadPageForUrl(KUrl("about:history"), value);
+ loadPageForUrl(KUrl("rekonq:history"), value);
return;
}
@@ -216,25 +216,25 @@ void NewTabPage::generate(const KUrl &url)
{
int value = url.queryItemValue(QL1S("location")).toInt();
HistoryManager::self()->removeHistoryLocationEntry(value);
- loadPageForUrl(KUrl("about:history"));
+ loadPageForUrl(KUrl("rekonq:history"));
return;
}
}
- // about:downloads links
- if (KUrl("about:downloads").isParentOf(url))
+ // rekonq:downloads links
+ if (KUrl("rekonq:downloads").isParentOf(url))
{
if (url.fileName() == QL1S("clear"))
{
DownloadManager::self()->clearDownloadsHistory();
- loadPageForUrl(KUrl("about:downloads"));
+ loadPageForUrl(KUrl("rekonq:downloads"));
return;
}
if (url.fileName() == QL1S("search"))
{
QString value = url.queryItemValue(QL1S("q"));
- loadPageForUrl(KUrl("about:downloads"), value);
+ loadPageForUrl(KUrl("rekonq:downloads"), value);
return;
}
@@ -250,25 +250,25 @@ void NewTabPage::generate(const KUrl &url)
{
int value = url.queryItemValue(QL1S("item")).toInt();
DownloadManager::self()->removeDownloadItem(value);
- loadPageForUrl(KUrl("about:downloads"));
+ loadPageForUrl(KUrl("rekonq:downloads"));
return;
}
}
- if (url == KUrl("about:bookmarks/edit"))
+ if (url == KUrl("rekonq:bookmarks/edit"))
{
BookmarkManager::self()->slotEditBookmarks();
return;
}
- if (url == KUrl("about:favorites/save"))
+ if (url == KUrl("rekonq:favorites/save"))
{
saveFavorites();
return;
}
-
+ kDebug() << "URL: " << url;
loadPageForUrl(url);
}
@@ -291,7 +291,7 @@ void NewTabPage::loadPageForUrl(const KUrl &url, const QString & filter)
QString title;
QByteArray encodedUrl = url.toEncoded();
- if (encodedUrl == QByteArray("about:favorites"))
+ if (encodedUrl == QByteArray("rekonq:favorites"))
{
favoritesPage();
// updateWindowIcon();
@@ -300,25 +300,25 @@ void NewTabPage::loadPageForUrl(const KUrl &url, const QString & filter)
initJS();
return;
}
- else if (encodedUrl == QByteArray("about:history"))
+ else if (encodedUrl == QByteArray("rekonq:history"))
{
historyPage(filter);
// updateWindowIcon();
title = i18n("History");
}
- else if (encodedUrl == QByteArray("about:bookmarks"))
+ else if (encodedUrl == QByteArray("rekonq:bookmarks"))
{
bookmarksPage();
// updateWindowIcon();
title = i18n("Bookmarks");
}
- else if (encodedUrl == QByteArray("about:downloads"))
+ else if (encodedUrl == QByteArray("rekonq:downloads"))
{
downloadsPage(filter);
// updateWindowIcon();
title = i18n("Downloads");
}
- else if (encodedUrl == QByteArray("about:closedTabs"))
+ else if (encodedUrl == QByteArray("rekonq:closedtabs"))
{
closedTabsPage();
// updateWindowIcon();
@@ -339,31 +339,31 @@ void NewTabPage::browsingMenu(const KUrl &currentUrl)
// Favorites
navItems.append(createLinkItem(i18n("Favorites"),
- QL1S("about:favorites"),
+ QL1S("rekonq:favorites"),
QL1S("emblem-favorite"),
KIconLoader::Toolbar));
// Bookmarks
navItems.append(createLinkItem(i18n("Bookmarks"),
- QL1S("about:bookmarks"),
+ QL1S("rekonq:bookmarks"),
QL1S("bookmarks"),
KIconLoader::Toolbar));
// History
navItems.append(createLinkItem(i18n("History"),
- QL1S("about:history"),
+ QL1S("rekonq:history"),
QL1S("view-history"),
KIconLoader::Toolbar));
// Downloads
navItems.append(createLinkItem(i18n("Downloads"),
- QL1S("about:downloads"),
+ QL1S("rekonq:downloads"),
QL1S("download"),
KIconLoader::Toolbar));
// Closed Tabs
navItems.append(createLinkItem(i18n("Closed Tabs"),
- QL1S("about:closedTabs"),
+ QL1S("rekonq:closedtabs"),
QL1S("tab-close"),
KIconLoader::Toolbar));
@@ -374,7 +374,7 @@ void NewTabPage::browsingMenu(const KUrl &currentUrl)
if (it.findFirst(aTagString).attribute(hrefAttributeString) == currentUrl.toMimeDataString())
it.addClass(QL1S("current"));
- else if (currentUrl == QL1S("about:home") && it.findFirst(aTagString).attribute(hrefAttributeString) == QL1S("about:favorites"))
+ else if (currentUrl == QL1S("rekonq:home") && it.findFirst(aTagString).attribute(hrefAttributeString) == QL1S("rekonq:favorites"))
it.addClass(QL1S("current"));
m_root.document().findFirst(QL1S("#navigation")).appendInside(it);
}
@@ -386,7 +386,7 @@ void NewTabPage::favoritesPage()
m_root.addClass(QL1S("favorites"));
QWebElement add = createLinkItem(i18n("Add Favorite"),
- QL1S("about:preview/add"),
+ QL1S("rekonq:preview/add"),
QL1S("list-add"),
KIconLoader::Toolbar);
add.setAttribute(QL1S("class"), QL1S("right"));
@@ -419,13 +419,13 @@ void NewTabPage::historyPage(const QString & filter)
{
m_root.addClass(QL1S("history"));
- QWebElement searchForm = createFormItem(i18n("Search History"), QL1S("about:history/search"));
+ QWebElement searchForm = createFormItem(i18n("Search History"), QL1S("rekonq:history/search"));
searchForm.setAttribute(QL1S("class"), QL1S("left"));
m_root.document().findFirst(QL1S("#actions")).appendInside(searchForm);
QWebElement clearHistory = createLinkItem(i18n("Clear History"),
- QL1S("about:history/clear"),
+ QL1S("rekonq:history/clear"),
QL1S("edit-clear"),
KIconLoader::Toolbar);
clearHistory.setAttribute(QL1S("class"), QL1S("right"));
@@ -500,7 +500,7 @@ void NewTabPage::historyPage(const QString & filter)
QWebElement removeLinkElement = item.findFirst(QL1S(".button"));
int histLoc = HistoryManager::self()->historyFilterModel()->historyLocation(u.url());
- removeLinkElement.setAttribute(QL1S("href"), QL1S("about:history/remove?location=") + QString::number(histLoc));
+ removeLinkElement.setAttribute(QL1S("href"), QL1S("rekonq:history/remove?location=") + QString::number(histLoc));
historyFolderElement.appendInside(QL1S("<br />"));
}
@@ -510,7 +510,7 @@ void NewTabPage::historyPage(const QString & filter)
{
m_root.appendInside(markup(QL1S("a")));
m_root.lastChild().setAttribute(QL1S("class") , QL1S("greybox"));
- m_root.lastChild().setAttribute(QL1S("href") , QL1S("about:history/showAllItems"));
+ m_root.lastChild().setAttribute(QL1S("href") , QL1S("rekonq:history/showAllItems"));
m_root.lastChild().setPlainText(i18n("Show full History"));
return;
}
@@ -526,7 +526,7 @@ void NewTabPage::bookmarksPage()
m_root.addClass(QL1S("bookmarks"));
QWebElement editBookmarks = createLinkItem(i18n("Edit Bookmarks"),
- QL1S("about:bookmarks/edit"),
+ QL1S("rekonq:bookmarks/edit"),
QL1S("bookmarks-organize"),
KIconLoader::Toolbar);
editBookmarks.setAttribute(QL1S("class"), QL1S("right"));
@@ -563,7 +563,7 @@ void NewTabPage::bookmarksPage()
void NewTabPage::closedTabsPage()
{
- m_root.addClass(QL1S("closedTabs"));
+ m_root.addClass(QL1S("closedtabs"));
QList<TabHistory> links = rApp->rekonqWindow()->tabWidget()->recentlyClosedTabs();
@@ -599,12 +599,12 @@ void NewTabPage::downloadsPage(const QString & filter)
{
m_root.addClass(QL1S("downloads"));
- QWebElement searchForm = createFormItem(i18n("Search Downloads"), QL1S("about:downloads/search"));
+ QWebElement searchForm = createFormItem(i18n("Search Downloads"), QL1S("rekonq:downloads/search"));
searchForm.setAttribute(QL1S("class"), QL1S("left"));
m_root.document().findFirst(QL1S("#actions")).appendInside(searchForm);
QWebElement clearDownloads = createLinkItem(i18n("Clear Downloads"),
- QL1S("about:downloads/clear"),
+ QL1S("rekonq:downloads/clear"),
QL1S("edit-clear"),
KIconLoader::Toolbar);
clearDownloads.setAttribute(QL1S("class"), QL1S("right"));
@@ -683,7 +683,7 @@ void NewTabPage::downloadsPage(const QString & filter)
{
div.appendInside(markup(QL1S("a")));
div.lastChild().setAttribute(QL1S("class"), QL1S("greylink"));
- div.lastChild().setAttribute(QL1S("href"), QL1S("about:downloads/opendir?q=") + QL1S("file://") + dir);
+ div.lastChild().setAttribute(QL1S("href"), QL1S("rekonq:downloads/opendir?q=") + QL1S("file://") + dir);
div.lastChild().setPlainText(i18n("Open directory"));
div.appendInside(QL1S(" - "));
@@ -702,7 +702,7 @@ void NewTabPage::downloadsPage(const QString & filter)
div.appendInside(markup(QL1S("a")));
div.lastChild().setAttribute(QL1S("class"), QL1S("greylink"));
- div.lastChild().setAttribute(QL1S("href"), QL1S("about:downloads/removeItem?item=") + QString::number(i));
+ div.lastChild().setAttribute(QL1S("href"), QL1S("rekonq:downloads/removeItem?item=") + QString::number(i));
div.lastChild().setPlainText(i18n("Remove from list"));
break;
@@ -768,7 +768,7 @@ QWebElement NewTabPage::emptyPreview(int index)
QL1S("file:///") + KIconLoader::global()->iconPath("insert-image", KIconLoader::Desktop));
prev.findFirst(QL1S("span a")).setPlainText(i18n("Set a Preview..."));
prev.findFirst(QL1S("a")).setAttribute(QL1S("href"),
- QL1S("about:preview/modify/") + QVariant(index).toString());
+ QL1S("rekonq:preview/modify/") + QVariant(index).toString());
setupPreview(prev, index, false);
@@ -815,7 +815,7 @@ QWebElement NewTabPage::tabPreview(int winIndex, int tabIndex, const KUrl &url,
QWebElement prev = markup(QL1S(".thumbnail"));
QString previewPath = QL1S("file://") + WebSnap::imagePathFromUrl(url);
- QString href = QL1S("about:tabs/show?win=") + QString::number(winIndex) + QL1S("&tab=") + QString::number(tabIndex);
+ QString href = QL1S("rekonq:tabs/show?win=") + QString::number(winIndex) + QL1S("&tab=") + QString::number(tabIndex);
prev.findFirst(QL1S(".preview img")).setAttribute(QL1S("src") , previewPath);
prev.findFirst(QL1S("a")).setAttribute(QL1S("href"), href);
@@ -840,7 +840,7 @@ QWebElement NewTabPage::closedTabPreview(int index, const KUrl &url, const QStri
: IconManager::self()->iconPathForUrl(url)
;
- QString href = QL1S("about:closedTabs/restore?tab=") + QString::number(index);
+ QString href = QL1S("rekonq:closedtabs/restore?tab=") + QString::number(index);
prev.findFirst(QL1S(".preview img")).setAttribute(QL1S("src") , previewPath);
prev.findFirst(QL1S("a")).setAttribute(QL1S("href"), href);
@@ -864,8 +864,8 @@ void NewTabPage::setupPreview(QWebElement e, int index, bool showControls)
e.findFirst(QL1S(".left")).setAttribute(QL1S("title"), i18n("Reload thumbnail"));
- e.findFirst(QL1S(".left")).setAttribute(QL1S("href"), QL1S("about:preview/reload/") + QVariant(index).toString());
- e.findFirst(QL1S(".right")).setAttribute(QL1S("href"), QL1S("about:preview/remove/") + QVariant(index).toString());
+ e.findFirst(QL1S(".left")).setAttribute(QL1S("href"), QL1S("rekonq:preview/reload/") + QVariant(index).toString());
+ e.findFirst(QL1S(".right")).setAttribute(QL1S("href"), QL1S("rekonq:preview/remove/") + QVariant(index).toString());
e.setAttribute(QL1S("id"), QL1S("preview") + QVariant(index).toString());
@@ -883,7 +883,7 @@ void NewTabPage::setupTabPreview(QWebElement e, int winIndex, int tabIndex)
QL1S("file:///") + KIconLoader::global()->iconPath("edit-delete", KIconLoader::DefaultState));
e.findFirst(QL1S(".right")).setAttribute(QL1S("title"), QL1S("Close Tab"));
- QString href = QL1S("about:tabs/remove?win=") + QString::number(winIndex) + QL1S("&tab=") + QString::number(tabIndex);
+ QString href = QL1S("rekonq:tabs/remove?win=") + QString::number(winIndex) + QL1S("&tab=") + QString::number(tabIndex);
e.findFirst(QL1S(".right")).setAttribute(QL1S("href"), href);
e.setAttribute(QL1S("id"), QL1S("win") + QString::number(winIndex) + QL1S("tab") + QString::number(tabIndex));
@@ -901,7 +901,7 @@ void NewTabPage::removePreview(int index)
ReKonfig::setPreviewNames(names);
ReKonfig::setPreviewUrls(urls);
- loadPageForUrl(KUrl("about:favorites"));
+ loadPageForUrl(KUrl("rekonq:favorites"));
ReKonfig::self()->writeConfig();
}
@@ -1037,7 +1037,7 @@ void NewTabPage::initJS()
javascript += QL1S(" revert: true,");
javascript += QL1S(" cursor: \"move\",");
javascript += QL1S(" distance: 30,");
- javascript += QL1S(" update: function(event, ui) { window.location.href = \"about:favorites/save\"; }");
+ javascript += QL1S(" update: function(event, ui) { window.location.href = \"rekonq:favorites/save\"; }");
javascript += QL1S(" });");
javascript += QL1S(" $( \".thumbnail\" ).disableSelection();");
javascript += QL1S("});");
@@ -1080,5 +1080,5 @@ void NewTabPage::saveFavorites()
ReKonfig::setPreviewNames(newNames);
ReKonfig::setPreviewUrls(newUrls);
- loadPageForUrl(KUrl("about:favorites"));
+ loadPageForUrl(KUrl("rekonq:favorites"));
}
diff --git a/src/rekonqpage/newtabpage.h b/src/rekonqpage/newtabpage.h
index 36f79401..a33657ea 100644
--- a/src/rekonqpage/newtabpage.h
+++ b/src/rekonqpage/newtabpage.h
@@ -53,10 +53,10 @@ public:
explicit NewTabPage(QWebFrame *frame);
/**
- * This method takes an about: url and loads
+ * This method takes an rekonq: url and loads
* the corresponding part of the new tab page
*/
- void generate(const KUrl &url = KUrl("about:home"));
+ void generate(const KUrl &url = KUrl("rekonq:home"));
private:
// these are the "high-level" functions to build the new tab page.
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 9890967f..54fe6009 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -301,7 +301,7 @@ void SessionManager::restoreCrashedSession()
: rApp->newWindow();
KUrl u = tw->currentWebWindow()->url();
- bool useCurrentTab = (u.isEmpty() || u.protocol() == QL1S("about"));
+ bool useCurrentTab = (u.isEmpty() || u.protocol() == QL1S("rekonq"));
int currentTab = loadTabs(tw, window, useCurrentTab);
tw->tabWidget()->setCurrentIndex(currentTab);
diff --git a/src/tabwindow/tabwidget.cpp b/src/tabwindow/tabwidget.cpp
index 1b5bca30..494d99f0 100644
--- a/src/tabwindow/tabwidget.cpp
+++ b/src/tabwindow/tabwidget.cpp
@@ -241,7 +241,7 @@ void TabWidget::init()
QList<TabHistory> list = SessionManager::self()->closedSitesForWindow( QL1S("win") + QString::number(n) );
Q_FOREACH(const TabHistory & tab, list)
{
- if (tab.url.startsWith(QL1S("about")))
+ if (tab.url.startsWith(QL1S("rekonq")))
continue;
m_recentlyClosedTabs.removeAll(tab);
m_recentlyClosedTabs.prepend(tab);
@@ -309,7 +309,7 @@ void TabWidget::newTab(WebPage *page)
switch (ReKonfig::newTabsBehaviour())
{
case 0: // new tab page
- tab->load(KUrl("about:home"));
+ tab->load(KUrl("rekonq:home"));
break;
case 2: // homepage
tab->load(KUrl(ReKonfig::homePage()));
@@ -650,12 +650,12 @@ void TabWidget::closeTab(int index, bool del)
return;
}
- currentWebWindow()->load(KUrl("about:home"));
+ currentWebWindow()->load(KUrl("rekonq:home"));
return;
}
if (!tabToClose->url().isEmpty()
- && tabToClose->url().scheme() != QL1S("about")
+ && tabToClose->url().scheme() != QL1S("rekonq")
&& !tabToClose->page()->settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)
)
{
@@ -708,7 +708,7 @@ void TabWidget::detachTab(int index, RekonqWindow *toWindow)
WebWindow *tab = webWindow(index);
KUrl u = tab->url();
- if (u.scheme() == QL1S("about"))
+ if (u.scheme() == QL1S("rekonq"))
{
closeTab(index);
loadUrl(u, Rekonq::NewWindow);
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;
diff --git a/src/webtab/previewselectorbar.cpp b/src/webtab/previewselectorbar.cpp
index b37b000c..f0fe50ee 100644
--- a/src/webtab/previewselectorbar.cpp
+++ b/src/webtab/previewselectorbar.cpp
@@ -69,7 +69,7 @@ PreviewSelectorBar::PreviewSelectorBar(int index, QWidget* parent)
void PreviewSelectorBar::verifyUrl()
{
WebTab *tab = qobject_cast<WebTab *>(parent());
- if (tab->url().scheme() != "about")
+ if (tab->url().scheme() != QL1S("rekonq"))
{
m_insertAction->setEnabled(true);
m_insertAction->setToolTip("");
@@ -122,7 +122,7 @@ void PreviewSelectorBar::clicked()
ReKonfig::self()->writeConfig();
- tab->page()->mainFrame()->load(KUrl("about:favorites"));
+ tab->page()->mainFrame()->load(KUrl("rekonq:favorites"));
}
animatedHide();
diff --git a/src/webtab/protocolhandler.cpp b/src/webtab/protocolhandler.cpp
index 886bec1e..138f297d 100644
--- a/src/webtab/protocolhandler.cpp
+++ b/src/webtab/protocolhandler.cpp
@@ -134,17 +134,11 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
return true;
}
- // "about" handling
- if (_url.protocol() == QL1S("about"))
+ // "rekonq" handling
+ if (_url.protocol() == QL1S("rekonq"))
{
QByteArray encodedUrl = _url.toEncoded();
- // let webkit manage the about:blank url...
- if (encodedUrl.startsWith(QByteArray("about:blank")))
- {
- return false;
- }
-
if (_url.directory() == QL1S("webapp"))
{
if (_url.fileName() == QL1S("launch"))
@@ -162,28 +156,28 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
}
}
- if (encodedUrl == QByteArray("about:home"))
+ if (encodedUrl == QByteArray("rekonq:home"))
{
switch (ReKonfig::newTabStartPage())
{
case 0: // favorites
- _url = KUrl("about:favorites");
+ _url = KUrl("rekonq:favorites");
break;
case 1: // bookmarks
- _url = KUrl("about:bookmarks");
+ _url = KUrl("rekonq:bookmarks");
break;
case 2: // history
- _url = KUrl("about:history");
+ _url = KUrl("rekonq:history");
break;
case 3: // downloads
- _url = KUrl("about:downloads");
+ _url = KUrl("rekonq:downloads");
break;
case 4: // closed tabs
- _url = KUrl("about:closedTabs");
+ _url = KUrl("rekonq:closedtabs");
break;
default: // unuseful
kDebug() << "oops... this should NOT happen...";
- _url = KUrl("about:favorites");
+ _url = KUrl("rekonq:favorites");
break;
}
}
diff --git a/src/webtab/webpage.cpp b/src/webtab/webpage.cpp
index 82c5cf60..6042cf32 100644
--- a/src/webtab/webpage.cpp
+++ b/src/webtab/webpage.cpp
@@ -709,7 +709,7 @@ QString WebPage::errorPage(QNetworkReply *reply)
msg += QL1S("<p>");
- msg += i18n("Maybe you are having problems with your network settings.<br />Try checking your <a href=\"%1\">network connections</a>, your <a href=\"%2\">proxy settings</a> and your <a href=\"%3\">firewall</a>.<br /><br />Then <a href=\"%4\">try again</a>.<br />", QL1S("about:settings/network"), QL1S("about:settings/proxy"), QL1S("about:settings/firewall"), urlString);
+ msg += i18n("Maybe you are having problems with your network settings.<br />Try checking your <a href=\"%1\">network connections</a>, your <a href=\"%2\">proxy settings</a> and your <a href=\"%3\">firewall</a>.<br /><br />Then <a href=\"%4\">try again</a>.<br />", QL1S("rekonq:settings/network"), QL1S("rekonq:settings/proxy"), QL1S("rekonq:settings/firewall"), urlString);
msg += QL1S("</p>");
diff --git a/src/webtab/webtab.cpp b/src/webtab/webtab.cpp
index 7743677c..fba824a1 100644
--- a/src/webtab/webtab.cpp
+++ b/src/webtab/webtab.cpp
@@ -197,7 +197,7 @@ KUrl WebTab::url()
QString WebTab::title()
{
- if (view() && url().protocol() == QL1S("about"))
+ if (view() && url().protocol() == QL1S("rekonq"))
return view()->title();
if (page() && page()->isOnRekonqPage())
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index a2854460..1a695f9c 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -949,13 +949,13 @@ void WebWindow::showCrashMessageBar()
void WebWindow::openNewWindow()
{
- rApp->loadUrl(QUrl("about:home"), Rekonq::NewWindow);
+ rApp->loadUrl(QUrl("rekonq:home"), Rekonq::NewWindow);
}
void WebWindow::checkFocus()
{
- if (url().scheme() == QL1S("about"))
+ if (url().scheme() == QL1S("rekonq"))
_bar->setFocus();
else
_tab->view()->setFocus();
@@ -964,19 +964,19 @@ void WebWindow::checkFocus()
void WebWindow::openDownloadsPage()
{
- rApp->loadUrl(QUrl("about:downloads"), Rekonq::NewFocusedTab);
+ rApp->loadUrl(QUrl("rekonq:downloads"), Rekonq::NewFocusedTab);
}
void WebWindow::openHistoryPage()
{
- rApp->loadUrl(QUrl("about:history"), Rekonq::NewFocusedTab);
+ rApp->loadUrl(QUrl("rekonq:history"), Rekonq::NewFocusedTab);
}
void WebWindow::openBookmarksPage()
{
- rApp->loadUrl(QUrl("about:bookmarks"), Rekonq::NewFocusedTab);
+ rApp->loadUrl(QUrl("rekonq:bookmarks"), Rekonq::NewFocusedTab);
}