forked from qt-creator/qt-creator
McuSupport: Move auto kit creation settings to handler"
Change-Id: I86a8588b812c10e0d547405c432f9fdc9c72aee3 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -51,12 +51,6 @@ using namespace Utils;
|
||||
|
||||
namespace McuSupport::Internal {
|
||||
|
||||
namespace {
|
||||
const QString automaticKitCreationSettingsKey = QLatin1String(Constants::SETTINGS_GROUP) + '/'
|
||||
+ QLatin1String(
|
||||
Constants::SETTINGS_KEY_AUTOMATIC_KIT_CREATION);
|
||||
}
|
||||
|
||||
McuSupportOptions::McuSupportOptions(const SettingsHandler::Ptr &settingsHandler, QObject *parent)
|
||||
: QObject(parent)
|
||||
, qtForMCUsSdkPackage(Sdk::createQtForMCUsPackage(settingsHandler))
|
||||
@@ -66,7 +60,7 @@ McuSupportOptions::McuSupportOptions(const SettingsHandler::Ptr &settingsHandler
|
||||
&McuAbstractPackage::changed,
|
||||
this,
|
||||
&McuSupportOptions::populatePackagesAndTargets);
|
||||
m_automaticKitCreation = automaticKitCreationFromSettings();
|
||||
m_automaticKitCreation = settingsHandler->isAutomaticKitCreationEnabled();
|
||||
}
|
||||
|
||||
void McuSupportOptions::populatePackagesAndTargets()
|
||||
@@ -197,17 +191,4 @@ void McuSupportOptions::setAutomaticKitCreationEnabled(const bool enabled)
|
||||
m_automaticKitCreation = enabled;
|
||||
}
|
||||
|
||||
void McuSupportOptions::writeGeneralSettings() const
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings(QSettings::UserScope);
|
||||
settings->setValue(automaticKitCreationSettingsKey, m_automaticKitCreation);
|
||||
}
|
||||
|
||||
bool McuSupportOptions::automaticKitCreationFromSettings()
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings(QSettings::UserScope);
|
||||
const bool automaticKitCreation = settings->value(automaticKitCreationSettingsKey, true).toBool();
|
||||
return automaticKitCreation;
|
||||
}
|
||||
|
||||
} // namespace McuSupport::Internal
|
||||
|
||||
Reference in New Issue
Block a user