From 9c042dff8f68c12498560921ce84564a1487acea Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Tue, 12 Jan 2010 04:19:02 +0000 Subject: [PATCH] Backport fix for bug 221371 (man: and info:foo doesn't work in KRunner, 4.3 regression) to KDE SC 4.4. BUG:221371 svn path=/branches/KDE/4.4/kdelibs/; revision=1073382 --- runnercontext.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/runnercontext.cpp b/runnercontext.cpp index 0daad5027..2bf9bad0b 100644 --- a/runnercontext.cpp +++ b/runnercontext.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "abstractrunner.h" #include "querymatch.h" @@ -188,16 +189,16 @@ class RunnerContextPrivate : public QSharedData // that it has arguments! type = (space > 0) ? RunnerContext::ShellCommand : RunnerContext::Executable; - } else if (path.indexOf('/') == -1 && path.indexOf('\\') == -1 ) { - //if a path doesn't have any slashes is a single word or - //sentence: is too ambiguous to be sure we're in a filesystem context - return; } else { KUrl url(term); QString correctCasePath; - if (!url.protocol().isEmpty() && !url.isLocalFile()) { + // 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()) { type = RunnerContext::NetworkLocation; - } else if (correctPathCase(path, correctCasePath)) { + } else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) && + correctPathCase(path, correctCasePath)) { path = correctCasePath; QFileInfo info(path);