Forwardport KDE 4.4 bugfix for KRunner (bug 224204, ftp/http URLs don't open web browser)

to KDE 4.5. Patch reviewed by Marco Martin.

BUG:224204

svn path=/trunk/KDE/kdelibs/; revision=1083225
This commit is contained in:
Michael Pyne 2010-01-31 21:22:13 +00:00
parent cc7c0a3359
commit 1ae27ef35f

View File

@ -192,10 +192,15 @@ class RunnerContextPrivate : public QSharedData
} else {
KUrl url(term);
QString correctCasePath;
// check for a normal URL first
if (KProtocolInfo::protocolClass(url.protocol()) == ":internet" &&
url.hasHost()) {
type = RunnerContext::NetworkLocation;
// check if we have a local network location first, otherwise assume a path,
// but if a path doesn't have any slashes is a single word or
// sentence: it's too ambiguous to be sure we're in a filesystem context
if (KProtocolInfo::protocolClass(url.protocol()) == ":local" && !url.isLocalFile()) {
} else if (KProtocolInfo::protocolClass(url.protocol()) == ":local" &&
!url.isLocalFile()) {
type = RunnerContext::NetworkLocation;
} else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) &&
correctPathCase(path, correctCasePath)) {