forked from qt-creator/qt-creator
Utils: Rework aspect implementation
This avoids some repetition and could be a step towards having type storage in (or rather accessible from) the base, so we can have aspects for more complex data (treemodels...) that are not easily converted to QVariant. Change-Id: I9797b3d5646195705212db1830d2b415291ac651 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -79,10 +79,8 @@ public:
|
||||
|
||||
auto updateAuthWidget = [authWidget]() {
|
||||
authWidget->updateClient(
|
||||
FilePath::fromUserInput(
|
||||
CopilotSettings::instance().nodeJsPath.volatileValue().toString()),
|
||||
FilePath::fromUserInput(
|
||||
CopilotSettings::instance().distPath.volatileValue().toString()));
|
||||
FilePath::fromUserInput(CopilotSettings::instance().nodeJsPath.volatileValue()),
|
||||
FilePath::fromUserInput(CopilotSettings::instance().distPath.volatileValue()));
|
||||
};
|
||||
|
||||
connect(CopilotSettings::instance().nodeJsPath.pathChooser(),
|
||||
|
||||
@@ -142,10 +142,8 @@ void CopilotPlugin::initialize()
|
||||
requestAction->setEnabled(enabled);
|
||||
};
|
||||
|
||||
connect(&CopilotSettings::instance().enableCopilot,
|
||||
&BoolAspect::valueChanged,
|
||||
this,
|
||||
updateActions);
|
||||
connect(&CopilotSettings::instance().enableCopilot, &BaseAspect::changed,
|
||||
this, updateActions);
|
||||
|
||||
updateActions();
|
||||
|
||||
|
||||
@@ -92,8 +92,8 @@ CopilotProjectSettings::CopilotProjectSettings(ProjectExplorer::Project *project
|
||||
QVariantMap map = project->namedSettings(Constants::COPILOT_PROJECT_SETTINGS_ID).toMap();
|
||||
fromMap(map);
|
||||
|
||||
connect(&enableCopilot, &BoolAspect::valueChanged, this, [this, project] { save(project); });
|
||||
connect(&useGlobalSettings, &BoolAspect::valueChanged, this, [this, project] { save(project); });
|
||||
connect(&enableCopilot, &BaseAspect::changed, this, [this, project] { save(project); });
|
||||
connect(&useGlobalSettings, &BaseAspect::changed, this, [this, project] { save(project); });
|
||||
}
|
||||
|
||||
void CopilotProjectSettings::setUseGlobalSettings(bool useGlobal)
|
||||
|
||||
Reference in New Issue
Block a user