From 83355540bf00698a78f17484c280c199cfb443f8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 30 Jul 2019 13:06:22 +0200 Subject: [PATCH] Utils::NameValueDictionary: Use the right path list separator The environment is not necessarily for the host OS. Change-Id: Ib0b0d3b8447fbb83c3860fb941b5d2445b8585d0 Reviewed-by: hjk --- src/libs/utils/namevaluedictionary.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/namevaluedictionary.cpp b/src/libs/utils/namevaluedictionary.cpp index 5dbdf75afef..67728d411f3 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 {