don't misidentify local files and network locations
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=818917
This commit is contained in:
parent
b8e211c2a4
commit
39230257f7
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
@ -77,7 +78,7 @@ class RunnerContext::Private : public QSharedData
|
|||||||
// code that may be running in multiple threads
|
// code that may be running in multiple threads
|
||||||
// with the same data.
|
// with the same data.
|
||||||
type = UnknownType;
|
type = UnknownType;
|
||||||
QString path = KShell::tildeExpand(term);
|
QString path = QDir::cleanPath(KShell::tildeExpand(term));
|
||||||
|
|
||||||
int space = term.indexOf(' ');
|
int space = term.indexOf(' ');
|
||||||
if (space > 0) {
|
if (space > 0) {
|
||||||
@ -88,9 +89,9 @@ class RunnerContext::Private : public QSharedData
|
|||||||
type = Executable;
|
type = Executable;
|
||||||
} else {
|
} else {
|
||||||
KUrl url(term);
|
KUrl url(term);
|
||||||
if (!url.protocol().isEmpty()) {
|
if (!url.protocol().isEmpty() && !url.isLocalFile()) {
|
||||||
type = NetworkLocation;
|
type = NetworkLocation;
|
||||||
} else if (QFile::exists(path)) {
|
} else if (QFile::exists(path)) {
|
||||||
QFileInfo info(path);
|
QFileInfo info(path);
|
||||||
if (info.isDir()) {
|
if (info.isDir()) {
|
||||||
type = Directory;
|
type = Directory;
|
||||||
|
Loading…
Reference in New Issue
Block a user