Commit 53e5e406 authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Show an explicit error for an unknown URL scheme

Because the error page shows an explanation, provided by
KIO::rawErrorDetail(), which gives useful troubleshooting
information for this specific problem.  Previously the error
given would have been "Improperly Formatted URL" which is
misleading.
parent a6a9e9e3
......@@ -94,6 +94,14 @@ QUrl KonqMisc::konqFilteredURL(KonqMainWindow *parent, const QString &_url, cons
}
}
// Show an explicit error for an unknown URL scheme, because the
// explanation generated by KIO::rawErrorDetail() gives useful
// information.
const QString scheme = data.uri().scheme();
if (!scheme.isEmpty() && !KProtocolInfo::isKnownProtocol(scheme)) {
return KParts::BrowserRun::makeErrorUrl(KIO::ERR_UNSUPPORTED_PROTOCOL, _url, QUrl(_url));
}
// NOTE: a valid URL like http://kde.org always passes the filtering test.
// As such, this point could only be reached when _url is NOT a valid URL.
return KParts::BrowserRun::makeErrorUrl(KIO::ERR_MALFORMED_URL, _url, QUrl(_url));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment