summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/protocolhandler.cpp10
-rw-r--r--src/urlbar/urlresolver.cpp13
-rw-r--r--src/webpage.cpp4
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