mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
plasma: fix directory existence checks in RunnerContext
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0208bcb22f
commit
6d7b5a6c4f
1 changed files with 5 additions and 5 deletions
|
@ -63,7 +63,7 @@ bool correctLastComponentCase(const QString &path, QString &correctCasePath, con
|
||||||
//kDebug() << "Correcting " << path;
|
//kDebug() << "Correcting " << path;
|
||||||
|
|
||||||
// If the file already exists then no need to search for it.
|
// If the file already exists then no need to search for it.
|
||||||
if (QFile::exists(path)) {
|
if (QFileInfo(path).exists()) {
|
||||||
correctCasePath = path;
|
correctCasePath = path;
|
||||||
//kDebug() << "Correct path is" << correctCasePath;
|
//kDebug() << "Correct path is" << correctCasePath;
|
||||||
return true;
|
return true;
|
||||||
|
@ -110,7 +110,7 @@ Returns true on success and false on error, in case of error, corrected is not m
|
||||||
bool correctPathCase(const QString& path, QString &corrected)
|
bool correctPathCase(const QString& path, QString &corrected)
|
||||||
{
|
{
|
||||||
// early exit check
|
// early exit check
|
||||||
if (QFile::exists(path)) {
|
if (QFileInfo(path).exists()) {
|
||||||
corrected = path;
|
corrected = path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -213,14 +213,14 @@ class RunnerContextPrivate : public QSharedData
|
||||||
// but if a path doesn't have any slashes
|
// but if a path doesn't have any slashes
|
||||||
// it's too ambiguous to be sure we're in a filesystem context
|
// it's too ambiguous to be sure we're in a filesystem context
|
||||||
path = QDir::cleanPath(url.toLocalFile());
|
path = QDir::cleanPath(url.toLocalFile());
|
||||||
//kDebug( )<< "slash check" << path;
|
// kDebug() << "slash check" << path << url;
|
||||||
if (hasProtocol || ((path.indexOf('/') != -1 || path.indexOf('\\') != -1))) {
|
if (hasProtocol || ((path.indexOf('/') != -1 || path.indexOf('\\') != -1))) {
|
||||||
QString correctCasePath;
|
QString correctCasePath;
|
||||||
if (correctPathCase(path, correctCasePath)) {
|
if (correctPathCase(path, correctCasePath)) {
|
||||||
|
// kDebug() << "correct case path is" << path << correctCasePath;
|
||||||
path = correctCasePath;
|
path = correctCasePath;
|
||||||
QFileInfo info(path);
|
QFileInfo info(path);
|
||||||
//kDebug( )<< "correct cas epath is" << correctCasePath << info.isSymLink() <<
|
// kDebug() << info.isSymLink() << info.isDir() << info.isFile();
|
||||||
// info.isDir() << info.isFile();
|
|
||||||
|
|
||||||
if (info.isSymLink()) {
|
if (info.isSymLink()) {
|
||||||
path = info.canonicalFilePath();
|
path = info.canonicalFilePath();
|
||||||
|
|
Loading…
Add table
Reference in a new issue