From 93dd4856d096e214786734db80ac8f778b913333 Mon Sep 17 00:00:00 2001 From: Guy Maurel Date: Mon, 16 Feb 2015 19:28:45 +0100 Subject: at KDesktopFile::locateLocal, correct the expression of the if statement which was always TRUE REVIEW: 122445 --- src/core/kdesktopfile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/kdesktopfile.cpp') 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); } } -- cgit v1.2.1