summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-06-28 00:26:09 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-06-28 00:26:09 +0200
commitb00a30c73a0b1301f2a9745014f07cf28220ee16 (patch)
treeefaac8536c86e1fadf1fa0bcc977770b8e3de3c7
parentMerge branch 'SC7_DEPS' (diff)
downloadrekonq-b00a30c73a0b1301f2a9745014f07cf28220ee16.tar.xz
This should fix "border" protocols handling like apt.
And it should also be a nice semplification :)
-rw-r--r--src/protocolhandler.cpp11
-rw-r--r--src/webpage.cpp15
2 files changed, 14 insertions, 12 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index 945f5b48..c5e0ef96 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -190,7 +190,7 @@ bool ProtocolHandler::postHandling(const QNetworkRequest &request, QWebFrame *fr
_frame = frame;
kDebug() << "URL PROTOCOL: " << _url;
-
+
// "http(s)" (fast) handling
if (_url.protocol() == QL1S("http") || _url.protocol() == QL1S("https"))
return false;
@@ -228,6 +228,15 @@ bool ProtocolHandler::postHandling(const QNetworkRequest &request, QWebFrame *fr
}
}
+ // we cannot handle this protocol in any way.
+ // Try KRunning it...
+ if (KProtocolInfo::isKnownProtocol(_url))
+ {
+ kDebug() << "WARNING: launching a new app...";
+ (void)new KRun(_url, rApp->mainWindow(), 0, _url.isLocalFile());
+ return true;
+ }
+
return false;
}
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 128d2e34..9499d6f7 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -409,17 +409,6 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply)
KIO::Integration::AccessManager::putReplyOnHold(reply);
- // get reply url...
- KUrl replyUrl = reply->url();
-
- bool isLocal = replyUrl.isLocalFile();
- if(isLocal && KProtocolInfo::isKnownProtocol(replyUrl))
- {
- kDebug() << "WARNING: launching a new app...";
- (void)new KRun(replyUrl, rApp->mainWindow(), 0, replyUrl.isLocalFile());
- return;
- }
-
// Get suggested file name...
extractSuggestedFileName(reply, _suggestedFileName);
@@ -436,6 +425,9 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply)
KService::Ptr appService = KMimeTypeTrader::self()->preferredService(_mimeType);
+ KUrl replyUrl = reply->url();
+ bool isLocal = replyUrl.isLocalFile();
+
if (appService.isNull()) // no service can handle this. We can just download it..
{
kDebug() << "no service can handle this. We can just download it..";
@@ -519,6 +511,7 @@ void WebPage::loadStarted()
{
}
+
void WebPage::loadFinished(bool ok)
{
Q_UNUSED(ok);