summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-11-17 09:00:13 +0100
committerEike Ziller <eike.ziller@qt.io>2020-11-17 10:41:05 +0000
commit8f655c60b72aae073fc4c72fa82111e956d873ce (patch)
tree91fdcee5693e072a93f5ffb058c6cc96cbe7e633
parent0a230928c0f524cce4591d9ba858e678f6b33e1d (diff)
downloadqt-creator-8f655c60b72aae073fc4c72fa82111e956d873ce.tar.gz
Add some known "path" variables to environment widget
Task-number: QTCREATORBUG-24925 Change-Id: I754a1dd1df88232570b33bb6eb05719dbb8d04fd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/plugins/projectexplorer/environmentwidget.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp
index a75ca25264..948bba7d43 100644
--- a/src/plugins/projectexplorer/environmentwidget.cpp
+++ b/src/plugins/projectexplorer/environmentwidget.cpp
@@ -28,6 +28,7 @@
#include <coreplugin/fileutils.h>
#include <coreplugin/find/itemviewfind.h>
+#include <utils/algorithm.h>
#include <utils/detailswidget.h>
#include <utils/environment.h>
#include <utils/environmentdialog.h>
@@ -449,6 +450,12 @@ bool EnvironmentWidget::currentEntryIsPathList(const QModelIndex &current) 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 &current) 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()