summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-02-07 10:25:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-08 10:53:55 +0100
commit85498fdedefdaaf0a6275bcb123d867a8509d643 (patch)
tree5457270328772342bee99bf8f5629d7a4760f32d
parent3e8af132dfaac5e16d5a2e3759aecc96726d8314 (diff)
downloadqtbase-85498fdedefdaaf0a6275bcb123d867a8509d643.tar.gz
qtbase-85498fdedefdaaf0a6275bcb123d867a8509d643.tar.bz2
qtbase-85498fdedefdaaf0a6275bcb123d867a8509d643.zip
QStandardPaths: remove trailing slash when reading from user-dirs.dirs
For consistency with all other sources of paths, which do not return a trailing slash, as tested by the unittest. This avoids double slashes in paths, after apps append something to the path. Change-Id: Iabcde11eee27df0b185780e2b655fbbb02ed63b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 1b9078f712..10ca20629e 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -205,6 +205,8 @@ QString QStandardPaths::writableLocation(StandardLocation type)
// value can start with $HOME
if (value.startsWith(QLatin1String("$HOME")))
value = QDir::homePath() + value.mid(5);
+ if (value.length() > 1 && value.endsWith(QLatin1Char('/')))
+ value.chop(1);
return value;
}
}