forked from qt-creator/qt-creator
MCU: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: Ib644dd6178bf9e0a1a75a2c6cf49fd5f3d121cf4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Piotr Mućko <piotr.mucko@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/infolabel.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/utilsicons.h>
|
||||
@@ -53,8 +54,7 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler,
|
||||
, m_downloadUrl(downloadUrl)
|
||||
, m_addToSystemPath(addToSystemPath)
|
||||
{
|
||||
m_path = FilePath::fromUserInput(
|
||||
qEnvironmentVariable(m_environmentVariableName.toStdString().c_str()));
|
||||
m_path = FilePath::fromUserInput(qtcEnvironmentVariable(m_environmentVariableName));
|
||||
if (!m_path.exists()) {
|
||||
m_path = this->settingsHandler->getPath(settingsKey, QSettings::UserScope, m_defaultPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user