diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-07-30 13:06:22 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-07-30 11:44:27 +0000 |
commit | 83355540bf00698a78f17484c280c199cfb443f8 (patch) | |
tree | 025890d85d556de0f9dae8b8fe6640040d0c1a3b /src/libs/utils/namevaluedictionary.cpp | |
parent | 6387be6f64694b9d96d8727e44bbc14386c683bb (diff) | |
download | qt-creator-83355540bf00698a78f17484c280c199cfb443f8.tar.gz |
Utils::NameValueDictionary: Use the right path list separator
The environment is not necessarily for the host OS.
Change-Id: Ib0b0d3b8447fbb83c3860fb941b5d2445b8585d0
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/libs/utils/namevaluedictionary.cpp')
-rw-r--r-- | src/libs/utils/namevaluedictionary.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libs/utils/namevaluedictionary.cpp b/src/libs/utils/namevaluedictionary.cpp index 5dbdf75afe..67728d411f 100644 --- a/src/libs/utils/namevaluedictionary.cpp +++ b/src/libs/utils/namevaluedictionary.cpp @@ -134,14 +134,6 @@ void NameValueDictionary::modify(const NameValueItems &items) *this = resultKeyValueDictionary; } -enum : char { -#ifdef Q_OS_WIN - pathSepC = ';' -#else - pathSepC = ':' -#endif -}; - NameValueItems NameValueDictionary::diff(const NameValueDictionary &other, bool checkAppendPrepend) const { NameValueMap::const_iterator thisIt = constBegin(); @@ -172,13 +164,13 @@ NameValueItems NameValueDictionary::diff(const NameValueDictionary &other, bool if (checkAppendPrepend && newValue.startsWith(oldValue) && oldEnabled == newEnabled) { QString appended = newValue.right(newValue.size() - oldValue.size()); - if (appended.startsWith(QLatin1Char(pathSepC))) + if (appended.startsWith(OsSpecificAspects::pathListSeparator(osType()))) appended.remove(0, 1); result.append(NameValueItem(otherIt.key(), appended, NameValueItem::Append)); } else if (checkAppendPrepend && newValue.endsWith(oldValue) && oldEnabled == newEnabled) { QString prepended = newValue.left(newValue.size() - oldValue.size()); - if (prepended.endsWith(QLatin1Char(pathSepC))) + if (prepended.endsWith(OsSpecificAspects::pathListSeparator(osType()))) prepended.chop(1); result.append(NameValueItem(otherIt.key(), prepended, NameValueItem::Prepend)); } else { |