diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-04-24 16:47:55 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-04-24 16:47:55 +0200 |
commit | 4c0ad2049f3b49590a7d19f89ebcb767c3c15283 (patch) | |
tree | c043cc517efb6e8601266977e9f17a1277d3c32f /src/mainwindow.cpp | |
parent | set Main Window on KDirLister (diff) | |
download | rekonq-4c0ad2049f3b49590a7d19f89ebcb767c3c15283.tar.xz |
Clean up url management
- Let ftp url(s) work again
- Do NOT check url twice via KUriFilter (removed MainWindow::filterUrl)
- ensure we are lowering just http url hosts
- mailto via urlbar handling
BUG: 298114
CCBUG: 284829
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 99430b9c..68772bea 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -86,7 +86,6 @@ #include <KParts/BrowserExtension> #include <KMimeTypeTrader> -#include <KUriFilterData> // Qt Includes #include <QtCore/QTimer> @@ -106,9 +105,6 @@ #include <QTextDocument> -KUriFilter *MainWindow::s_uriFilter; - - MainWindow::MainWindow() : KXmlGuiWindow() , m_view(new MainView(this)) @@ -228,9 +224,6 @@ MainWindow::MainWindow() // accept d'n'd setAcceptDrops(true); - if (!s_uriFilter) - s_uriFilter = KUriFilter::self(); - // Things that need to be setup after the call to setupGUI() and after ctor call QTimer::singleShot(1, this, SLOT(postLaunch())); } @@ -1625,9 +1618,9 @@ void MainWindow::loadUrl(const KUrl& url, void MainWindow::loadCheckedUrl(const KUrl& url, const Rekonq::OpenType& type, QWebHistory *webHistory) { - // First, calculate url - KUrl urlToLoad = filterUrlToLoad(url); - + // NOTE: At this point, url should just be resolved via urlresolver. + // No need to check it twice + WebTab *tab = 0; switch (type) { @@ -1656,7 +1649,7 @@ void MainWindow::loadCheckedUrl(const KUrl& url, const Rekonq::OpenType& type, Q WebView *view = tab->view(); if (view) { - view->load(urlToLoad); + view->load(url); if (webHistory) { @@ -1669,29 +1662,3 @@ void MainWindow::loadCheckedUrl(const KUrl& url, const Rekonq::OpenType& type, Q } } } - - -// ------------------------------------------------------------------------------------------ - - -KUrl MainWindow::filterUrlToLoad(const KUrl &url) -{ - QString urlString = url.pathOrUrl(); - // Bookmarklets handling - if (urlString.startsWith(QL1S("javascript:"))) - { - return KUrl(urlString); - } - - // this should let rekonq filtering URI info and supporting - // the beautiful KDE web browsing shortcuts - KUriFilterData data(urlString); - data.setCheckForExecutables(false); // if true, queries like "rekonq" or "dolphin" are considered as executables - - if (s_uriFilter->filterUri(data) && data.uriType() != KUriFilterData::Error) - { - return data.uri(); - } - - return QUrl::fromUserInput(urlString); -} |