Fix bug 221371 in KDE 4.5 (man: and info: syntax no longer works in krunner)

svn path=/trunk/KDE/kdelibs/; revision=1073381
This commit is contained in:
Michael Pyne 2010-01-12 04:14:32 +00:00
parent 40b3e0bed5
commit 564d86e134

View File

@ -33,6 +33,7 @@
#include <kshell.h> #include <kshell.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kurl.h> #include <kurl.h>
#include <kprotocolinfo.h>
#include "abstractrunner.h" #include "abstractrunner.h"
#include "querymatch.h" #include "querymatch.h"
@ -188,16 +189,16 @@ class RunnerContextPrivate : public QSharedData
// that it has arguments! // that it has arguments!
type = (space > 0) ? RunnerContext::ShellCommand : type = (space > 0) ? RunnerContext::ShellCommand :
RunnerContext::Executable; 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 { } else {
KUrl url(term); KUrl url(term);
QString correctCasePath; 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; type = RunnerContext::NetworkLocation;
} else if (correctPathCase(path, correctCasePath)) { } else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) &&
correctPathCase(path, correctCasePath)) {
path = correctCasePath; path = correctCasePath;
QFileInfo info(path); QFileInfo info(path);