From 8f655c60b72aae073fc4c72fa82111e956d873ce Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 17 Nov 2020 09:00:13 +0100 Subject: [PATCH] Add some known "path" variables to environment widget Task-number: QTCREATORBUG-24925 Change-Id: I754a1dd1df88232570b33bb6eb05719dbb8d04fd Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/environmentwidget.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index a75ca25264d..948bba7d430 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -449,6 +450,12 @@ bool EnvironmentWidget::currentEntryIsPathList(const QModelIndex ¤t) const return true; if (Utils::HostOsInfo::isAnyUnixHost() && varName == "LD_LIBRARY_PATH") return true; + if (varName == "PKG_CONFIG_DIR") + return true; + if (Utils::HostOsInfo::isWindowsHost() + && QStringList{"INCLUDE", "LIB", "LIBPATH"}.contains(varName)) { + return true; + } // Now check the value: If it's a list of strings separated by the platform's path separator // and at least one of the strings is an existing directory, then that's enough proof for us. @@ -459,11 +466,7 @@ bool EnvironmentWidget::currentEntryIsPathList(const QModelIndex ¤t) const .split(Utils::HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts); if (entries.length() < 2) return false; - for (const QString &potentialDir : entries) { - if (QFileInfo(potentialDir).isDir()) - return true; - } - return false; + return Utils::anyOf(entries, [](const QString &d) { return QFileInfo(d).isDir(); }); } void EnvironmentWidget::updateButtons()