From 86ccea46b6012e7a50b5e8b9a5a169e54592e262 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 19 Dec 2007 07:01:16 +0000 Subject: [PATCH] do tilde expansion BUG:153326 svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=750316 --- searchcontext.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/searchcontext.cpp b/searchcontext.cpp index 1179203af..98b75e793 100644 --- a/searchcontext.cpp +++ b/searchcontext.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -158,27 +159,28 @@ void SearchContext::determineType() { d->lockForWrite(); QString term = d->term; + QString path = KShell::tildeExpand(term); int space = term.indexOf(' '); if (space > 0) { - if (!KStandardDirs::findExe(term.left(space)).isEmpty()) { + if (!KStandardDirs::findExe(path.left(space)).isEmpty()) { d->type = ShellCommand; } - } else if (!KStandardDirs::findExe(term.left(space)).isEmpty()) { + } else if (!KStandardDirs::findExe(path.left(space)).isEmpty()) { d->type = Executable; } else { KUrl url(term); if (!url.protocol().isEmpty() && !url.host().isEmpty()) { d->type = NetworkLocation; - } else if (QFile::exists(term)) { - QFileInfo info(term); + } else if (QFile::exists(path)) { + QFileInfo info(path); if (info.isDir()) { d->type = Directory; d->mimetype = "inode/folder"; } else { d->type = File; - KMimeType::Ptr mimetype = KMimeType::findByPath(term); + KMimeType::Ptr mimetype = KMimeType::findByPath(path); if (mimetype) { d->mimetype = mimetype->name(); }