diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-05-28 16:41:49 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-03 15:14:42 +0200 |
commit | e4079eca49adce16e31dac2a18d49d7a55817891 (patch) | |
tree | 1dfb960ec1115b1f552afe8a013058542389505e /src/corelib/io/qstandardpaths_unix.cpp | |
parent | f32a6cfb6b6236533508901f114ab57396da8ff3 (diff) | |
parent | ec6dc5f78453048c4f0604655a34c6c20c79d819 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.
Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
Diffstat (limited to 'src/corelib/io/qstandardpaths_unix.cpp')
-rw-r--r-- | src/corelib/io/qstandardpaths_unix.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index eaa545b4fd..0c276e0a56 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -284,16 +284,12 @@ static QStringList xdgDataDirs() dirs.append(QString::fromLatin1("/usr/local/share")); dirs.append(QString::fromLatin1("/usr/share")); } else { - dirs = xdgDataDirsEnv.split(QLatin1Char(':'), QString::SkipEmptyParts); + const auto parts = xdgDataDirsEnv.splitRef(QLatin1Char(':'), QString::SkipEmptyParts); // Normalize paths, skip relative paths - QMutableListIterator<QString> it(dirs); - while (it.hasNext()) { - const QString dir = it.next(); - if (!dir.startsWith(QLatin1Char('/'))) - it.remove(); - else - it.setValue(QDir::cleanPath(dir)); + for (const QStringRef &dir : parts) { + if (dir.startsWith(QLatin1Char('/'))) + dirs.push_back(QDir::cleanPath(dir.toString())); } // Remove duplicates from the list, there's no use for duplicated |