Environment::value(): Use findKey() helper

Also change path() to use value() so that "Path" as used on Windows
will be found as well.

Task-number: QTCREATORBUG-18958
Change-Id: Ie930f6a6e71c76459cf9d089c225f5b1adf52433
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Friedemann Kleint
2017-09-25 12:19:14 +02:00
parent 0c1bb6d913
commit ede5e0c586

View File

@@ -454,13 +454,14 @@ FileName Environment::searchInPath(const QString &executable,
QStringList Environment::path() const
{
return m_values.value("PATH")
return value("PATH")
.split(OsSpecificAspects(m_osType).pathListSeparator(), QString::SkipEmptyParts);
}
QString Environment::value(const QString &key) const
{
return m_values.value(key);
const auto it = findKey(m_values, m_osType, key);
return it != m_values.end() ? it.value() : QString();
}
QString Environment::key(Environment::const_iterator it) const