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>
This commit is contained in:
parent
3e8af132df
commit
85498fdede
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user