summaryrefslogtreecommitdiff
path: root/src/protocolhandler.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-03-03 12:04:14 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-03-03 12:04:14 +0100
commit6f36358bd4ffd696b2e627b92e74ed302fb22e7f (patch)
tree01a08f764ebf94b0bb343f0fc72fe1fc4a712db6 /src/protocolhandler.cpp
parentPrevent crashes on history models updating... (diff)
downloadrekonq-6f36358bd4ffd696b2e627b92e74ed302fb22e7f.tar.xz
Clean up the "rekonq handling chain" to work as:
1. preHandling: about, javascript, abp protocols. Stops if protocol is NOT known 2. WebKit handling: Allow WebKit to try doing its job 3. postHandling / unsupported content handling: try what is possible to let users see it :) This also prevents some possible infinite loop on opening... BUG:267201
Diffstat (limited to 'src/protocolhandler.cpp')
-rw-r--r--src/protocolhandler.cpp36
1 files changed, 8 insertions, 28 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index 2c5f2ada..36efe2a7 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -101,22 +101,6 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
_url = request.url();
_frame = frame;
- // rekonq can handle http/s browsing easily
- if (_url.protocol() == QL1S("http") || _url.protocol() == QL1S("https"))
- return false;
-
- // rekonq can handle file & ftp schemes, if you like,,
- if (_url.protocol() == QL1S("ftp") || _url.protocol() == QL1S("file"))
- return false;
-
- // rekonq can handle kde documentation protocol
- if (_url.protocol() == QL1S("man") || _url.protocol() == QL1S("help") || _url.protocol() == QL1S("info"))
- return false;
-
- // relative urls
- if (_url.isRelative())
- return false;
-
// javascript handling
if (_url.protocol() == QL1S("javascript"))
{
@@ -140,9 +124,6 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
return true;
}
- // NOTE
- // handle here "custom" rekonq protocols
-
// "abp" handling
if (_url.protocol() == QL1S("abp"))
{
@@ -192,18 +173,17 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
return true;
}
- // If rekonq cannot handle a protocol by itself, it will hand it over to KDE via KRun
+ // let webkit try to load a known (or missing) protocol...
if (KProtocolInfo::isKnownProtocol(_url))
- {
- new KRun(_url, rApp->mainWindow()); // No need to delete KRun, it autodeletes itself
- return true;
- }
-
- // Error Message, for those protocols even KDE cannot handle
+ return false;
+
+ // Error Message, for those protocols we cannot handle
+ // FIXME change this sentence AFTER STRING FREEZE to: "rekonq doesn't know how to handle this protocol: _url.protocol()"
KMessageBox::error(rApp->mainWindow(), i18nc("@info",
"rekonq cannot handle this URL. \
- Please use an appropriate application to open it."));
- return false;
+ Please use an appropriate application to open it."));
+
+ return true;
}