don't misidentify local files and network locations

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=818917
This commit is contained in:
Aaron J. Seigo 2008-06-10 01:08:33 +00:00
parent b8e211c2a4
commit 39230257f7

View File

@ -21,6 +21,7 @@
#include <QReadWriteLock>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QSharedData>
@ -77,7 +78,7 @@ class RunnerContext::Private : public QSharedData
// code that may be running in multiple threads
// with the same data.
type = UnknownType;
QString path = KShell::tildeExpand(term);
QString path = QDir::cleanPath(KShell::tildeExpand(term));
int space = term.indexOf(' ');
if (space > 0) {
@ -88,9 +89,9 @@ class RunnerContext::Private : public QSharedData
type = Executable;
} else {
KUrl url(term);
if (!url.protocol().isEmpty()) {
if (!url.protocol().isEmpty() && !url.isLocalFile()) {
type = NetworkLocation;
} else if (QFile::exists(path)) {
} else if (QFile::exists(path)) {
QFileInfo info(path);
if (info.isDir()) {
type = Directory;