aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Maurel <guy.maurel@kde.org>2015-02-16 19:28:45 +0100
committerGuy Maurel <guy.maurel@kde.org>2015-02-16 19:28:45 +0100
commit93dd4856d096e214786734db80ac8f778b913333 (patch)
tree3f7753542aa6725cf39d5e8e973285fde495f6f4
parent8926388f51f77cd64abf1111b6aa887acb78d22e (diff)
downloadkconfig-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.cpp5
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);
}
}