if a path doesn't have any slash is too ambiguous to be sure we're in filesystem context

svn path=/trunk/KDE/kdelibs/; revision=1052112
This commit is contained in:
Marco Martin 2009-11-20 20:01:32 +00:00
parent 3b7483877d
commit 43bb2fe895

View File

@ -186,6 +186,10 @@ 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;
@ -194,6 +198,7 @@ class RunnerContextPrivate : public QSharedData
} else if (correctPathCase(path, correctCasePath)) { } else if (correctPathCase(path, correctCasePath)) {
path = correctCasePath; path = correctCasePath;
QFileInfo info(path); QFileInfo info(path);
if (info.isSymLink()) { if (info.isSymLink()) {
path = info.canonicalFilePath(); path = info.canonicalFilePath();
info = QFileInfo(path); info = QFileInfo(path);