From 79e11d892e2ff26636a647e91371aaef2c5d435d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 2 Oct 2009 16:20:18 +0200 Subject: moving from about: protocol to rekonq: protocol :D This fix some issues, about some "stupid" sites whose js sends strange "about:blank" requests (just found 2!!) --- src/application.cpp | 10 +++++----- src/application.h | 2 +- src/history.cpp | 4 ++-- src/homepage.cpp | 16 ++++++++-------- src/homepage.h | 2 +- src/mainview.cpp | 4 ++-- src/networkaccessmanager.cpp | 26 -------------------------- src/networkaccessmanager.h | 3 --- src/sessionmanager.h | 1 - src/urlbar.cpp | 2 +- src/webpage.cpp | 2 +- 11 files changed, 21 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index bffcb2ae..a7ac47ce 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -420,11 +420,11 @@ MainWindowList Application::mainWindowList() bool Application::homePage(const KUrl &url) { - if ( url == KUrl("about:lastSites") - || url == KUrl("about:history") - || url == KUrl("about:bookmarks") - || url == KUrl("about:favorites") - || url == KUrl("about:home") + if ( url == KUrl("rekonq:lastSites") + || url == KUrl("rekonq:history") + || url == KUrl("rekonq:bookmarks") + || url == KUrl("rekonq:favorites") + || url == KUrl("rekonq:home") ) { kDebug() << "loading home: " << url; diff --git a/src/application.h b/src/application.h index 7a0e884c..eadacfa0 100644 --- a/src/application.h +++ b/src/application.h @@ -101,7 +101,7 @@ public: MainWindow *mainWindow(); MainWindowList mainWindowList(); - bool homePage(const KUrl &url = KUrl("about:home")); + bool homePage(const KUrl &url = KUrl("rekonq:home")); static KIcon icon(const KUrl &url); diff --git a/src/history.cpp b/src/history.cpp index 7e5cb741..aac3a66d 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -115,8 +115,8 @@ void HistoryManager::addHistoryEntry(const QString &url) { QUrl cleanUrl(url); - // don't store about: urls (home page related) - if(cleanUrl.scheme() == QString("about")) + // don't store rekonq: urls (home page related) + if(cleanUrl.scheme() == QString("rekonq")) return; cleanUrl.setPassword(QString()); diff --git a/src/homepage.cpp b/src/homepage.cpp index bfbf0400..723e670c 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -75,13 +75,13 @@ QString HomePage::rekonqHomePage(const KUrl &url) QString menu = homePageMenu(); QString speed; - if(url == KUrl("about:lastSites")) + if(url == KUrl("rekonq:lastSites")) speed = lastVisitedSites(); - if(url == KUrl("about:history")) + if(url == KUrl("rekonq:history")) speed = fillHistory(); - if(url == KUrl("about:bookmarks")) + if(url == KUrl("rekonq:bookmarks")) speed = fillBookmarks(); - if(url == KUrl("about:home") || url == KUrl("about:favorites")) + if(url == KUrl("rekonq:home") || url == KUrl("rekonq:favorites")) speed = fillFavorites(); QString html = QString(QLatin1String(file.readAll())) @@ -163,10 +163,10 @@ QString HomePage::lastVisitedSites() QString HomePage::homePageMenu() { QString menu = ""; - menu += "
Last Visited Sites
"; - menu += "
History
"; - menu += "
Bookmarks
"; - menu += "
Favorites
"; + menu += "
Last Visited Sites
"; + menu += "
History
"; + menu += "
Bookmarks
"; + menu += "
Favorites
"; return menu; } diff --git a/src/homepage.h b/src/homepage.h index af5185c8..b1202cb0 100644 --- a/src/homepage.h +++ b/src/homepage.h @@ -47,7 +47,7 @@ public: HomePage(QObject *parent = 0); ~HomePage(); - QString rekonqHomePage(const KUrl &url = KUrl("about:home")); + QString rekonqHomePage(const KUrl &url = KUrl("rekonq:home")); QString homePageMenu(); private: diff --git a/src/mainview.cpp b/src/mainview.cpp index 20cac359..4fa40b6d 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -306,8 +306,8 @@ void MainView::newTab() switch(ReKonfig::newTabsBehaviour()) { case 0: - Application::instance()->homePage(); - break; + if(Application::instance()->homePage()) + break; case 1: urlBar()->setUrl(KUrl("")); break; diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index c21d54df..10a7978f 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -189,29 +189,3 @@ void NetworkAccessManager::slotSSLErrors(QNetworkReply *reply, const QListignoreSslErrors(); } #endif - - -// QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData) -// { -// // TODO implement Ad-Block here (refuse connections..) -// -// QNetworkRequest request(req); -// KIO::MetaData metaData = m_sessionMetaData; -// metaData += m_requestMetaData; -// -// QVariant attr = req.attribute(QNetworkRequest::User); -// if (attr.isValid() && attr.type() == QVariant::Map) -// { -// metaData += attr.toMap(); -// } -// -// if (!metaData.isEmpty()) -// { -// attr = metaData.toVariant(); -// request.setAttribute(QNetworkRequest::User, attr); -// } -// -// // Clear the per request meta data... -// m_requestMetaData.clear(); -// return AccessManager::createRequest(op, request, outgoingData); -// } diff --git a/src/networkaccessmanager.h b/src/networkaccessmanager.h index 9e23a96e..cfe98806 100644 --- a/src/networkaccessmanager.h +++ b/src/networkaccessmanager.h @@ -46,9 +46,6 @@ public: public slots: void loadSettings(); -// protected: -// virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0); - private slots: void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth); void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth); diff --git a/src/sessionmanager.h b/src/sessionmanager.h index b66415e5..12435702 100644 --- a/src/sessionmanager.h +++ b/src/sessionmanager.h @@ -49,7 +49,6 @@ public: private slots: void saveSession(); - private: QString m_sessionFilePath; bool m_safe; diff --git a/src/urlbar.cpp b/src/urlbar.cpp index ba50d068..5776961b 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -133,7 +133,7 @@ void UrlBar::setupLineEdit() void UrlBar::setUrl(const QUrl& url) { - if(url.scheme() == "about") + if(url.scheme() == "rekonq") { setFocus(); return; diff --git a/src/webpage.cpp b/src/webpage.cpp index 3f5e6244..59c777d6 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -107,7 +107,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r return false; } - if (request.url().scheme() == QLatin1String("about")) + if (request.url().scheme() == QLatin1String("rekonq")) { Application::instance()->loadUrl( request.url() ); return false; -- cgit v1.2.1