forked from qt-creator/qt-creator
Add some known "path" variables to environment widget
Task-number: QTCREATORBUG-24925 Change-Id: I754a1dd1df88232570b33bb6eb05719dbb8d04fd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#include <coreplugin/fileutils.h>
|
#include <coreplugin/fileutils.h>
|
||||||
#include <coreplugin/find/itemviewfind.h>
|
#include <coreplugin/find/itemviewfind.h>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/environmentdialog.h>
|
#include <utils/environmentdialog.h>
|
||||||
@@ -449,6 +450,12 @@ bool EnvironmentWidget::currentEntryIsPathList(const QModelIndex ¤t) const
|
|||||||
return true;
|
return true;
|
||||||
if (Utils::HostOsInfo::isAnyUnixHost() && varName == "LD_LIBRARY_PATH")
|
if (Utils::HostOsInfo::isAnyUnixHost() && varName == "LD_LIBRARY_PATH")
|
||||||
return true;
|
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
|
// 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.
|
// 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);
|
.split(Utils::HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts);
|
||||||
if (entries.length() < 2)
|
if (entries.length() < 2)
|
||||||
return false;
|
return false;
|
||||||
for (const QString &potentialDir : entries) {
|
return Utils::anyOf(entries, [](const QString &d) { return QFileInfo(d).isDir(); });
|
||||||
if (QFileInfo(potentialDir).isDir())
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnvironmentWidget::updateButtons()
|
void EnvironmentWidget::updateButtons()
|
||||||
|
|||||||
Reference in New Issue
Block a user