From 85498fdedefdaaf0a6275bcb123d867a8509d643 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 7 Feb 2014 10:25:31 +0100 Subject: 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 --- src/corelib/io/qstandardpaths_unix.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; } } -- cgit v1.2.3