forked from qt-creator/qt-creator
McuSupport: Use env variable as package's primary value
Use env variable value as primary source before values from settings and fallback value from JSON. Change-Id: I0c0a4c2cdac65a075d9f38aa1557a9d303b30a5e Reviewed-by: Yasser Grimes <yasser.grimes@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -75,7 +75,11 @@ McuPackage::McuPackage(const SettingsHandler::Ptr &settingsHandler,
|
||||
, m_downloadUrl(downloadUrl)
|
||||
, m_addToSystemPath(addToSystemPath)
|
||||
{
|
||||
m_path = this->settingsHandler->getPath(settingsKey, QSettings::UserScope, m_defaultPath);
|
||||
m_path = FilePath::fromString(
|
||||
qEnvironmentVariable(m_environmentVariableName.toStdString().c_str()));
|
||||
if (!m_path.exists()) {
|
||||
m_path = this->settingsHandler->getPath(settingsKey, QSettings::UserScope, m_defaultPath);
|
||||
}
|
||||
}
|
||||
|
||||
QString McuPackage::label() const
|
||||
@@ -125,7 +129,7 @@ FilePath McuPackage::path() const
|
||||
|
||||
FilePath McuPackage::defaultPath() const
|
||||
{
|
||||
return m_defaultPath;
|
||||
return m_defaultPath.cleanPath();
|
||||
}
|
||||
|
||||
FilePath McuPackage::detectionPath() const
|
||||
|
||||
Reference in New Issue
Block a user