diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-04-24 16:47:55 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-04-27 01:38:41 +0200 |
commit | 6a9e1ed2d94202eb1c7b334b1020abad64d8226f (patch) | |
tree | cfaa734fb6921fd312f0a58a0640f4b77e9f99a2 /src | |
parent | set Main Window on KDirLister (diff) | |
download | rekonq-6a9e1ed2d94202eb1c7b334b1020abad64d8226f.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
CCBUG: 298114
CCBUG: 284829
Conflicts:
src/mainwindow.cpp
Backporting from master with the needed fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 1 | ||||
-rw-r--r-- | src/protocolhandler.cpp | 10 | ||||
-rw-r--r-- | src/urlbar/urlresolver.cpp | 13 | ||||
-rw-r--r-- | src/webpage.cpp | 4 |
4 files changed, 21 insertions, 7 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e954e7d3..51f9660c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -85,6 +85,7 @@ #include <KParts/BrowserExtension> #include <KMimeTypeTrader> + // Qt Includes #include <QtCore/QTimer> diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index 096aec24..e396ea5e 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -176,7 +176,15 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra return true; } - + + // "mailto" handling: It needs to be handled both in preHandling (mail url launched) + // and in postHandling (mail links clicked) + if (_url.protocol() == QL1S("mailto")) + { + KToolInvocation::invokeMailer(_url); + return true; + } + // "apt" handling // NOTE: this is a stupid workaround to ensure apt protocol works if (_url.protocol() == QL1S("apt")) diff --git a/src/urlbar/urlresolver.cpp b/src/urlbar/urlresolver.cpp index 6d6a2378..833a48f9 100644 --- a/src/urlbar/urlresolver.cpp +++ b/src/urlbar/urlresolver.cpp @@ -35,11 +35,7 @@ // KDE Includes #include <KBookmark> -#include <KUriFilter> -#include <KCompletion> #include <KService> -#include <KConfig> -#include <KConfigGroup> #include <KProtocolInfo> // Qt Includes @@ -256,9 +252,14 @@ void UrlResolver::computeQurlFromUserInput() QUrl urlFromUserInput = QUrl::fromUserInput(url); if (urlFromUserInput.isValid()) { + // ensure http(s) hosts are lower cases + if (urlFromUserInput.scheme().startsWith("http")) + { + QString hst = urlFromUserInput.host(); + urlFromUserInput.setHost(hst.toLower()); + } + QString urlString = urlFromUserInput.toString(); - if (!urlFromUserInput.isLocalFile()) - urlString = urlString.toLower(); QString gTitle = i18nc("Browse a website", "Browse"); UrlSearchItem gItem(UrlSearchItem::Browse, urlString, gTitle); _qurlFromUserInput << gItem; diff --git a/src/webpage.cpp b/src/webpage.cpp index f22d478b..86261e36 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -500,6 +500,10 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) break; case QNetworkReply::UnknownNetworkError: // unknown network-related error detected + // last chance for the strange things (eg: FTP, custom schemes, etc...) + if (_protHandler.postHandling(reply->request(), mainFrame())) + return; + case QNetworkReply::ConnectionRefusedError: // remote server refused connection case QNetworkReply::HostNotFoundError: // invalid hostname case QNetworkReply::TimeoutError: // connection time out |