diff options
author | Guy Maurel <guy.maurel@kde.org> | 2015-02-16 19:28:45 +0100 |
---|---|---|
committer | Guy Maurel <guy.maurel@kde.org> | 2015-02-16 19:28:45 +0100 |
commit | 93dd4856d096e214786734db80ac8f778b913333 (patch) | |
tree | 3f7753542aa6725cf39d5e8e973285fde495f6f4 | |
parent | 8926388f51f77cd64abf1111b6aa887acb78d22e (diff) | |
download | kconfig-93dd4856d096e214786734db80ac8f778b913333.tar.gz kconfig-93dd4856d096e214786734db80ac8f778b913333.tar.bz2 |
at KDesktopFile::locateLocal, correct the expression of the if statement which was always TRUE
REVIEW: 122445
-rw-r--r-- | src/core/kdesktopfile.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp index 6381cb30..254b59a6 100644 --- a/src/core/kdesktopfile.cpp +++ b/src/core/kdesktopfile.cpp @@ -79,16 +79,17 @@ KConfigGroup KDesktopFile::desktopGroup() const QString KDesktopFile::locateLocal(const QString &path) { QString relativePath; + QChar plus(QLatin1Char('/')); // Relative to config? (e.g. for autostart) Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) { - if (path.startsWith(dir) + '/') { + if (path.startsWith(dir + plus)) { relativePath = dir.mid(path.length() + 1); return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + relativePath; } } // Relative to xdg data dir? (much more common) Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) { - if (path.startsWith(dir) + '/') { + if (path.startsWith(dir + plus)) { relativePath = dir.mid(path.length() + 1); } } |