diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 051a641afbd..57069ffcf11 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -496,16 +496,6 @@ Core::Id KitAspectWidget::kitInformationId() const return m_kitInformation->id(); } -bool KitAspectWidget::isMutable() const -{ - return m_kit->isMutable(m_kitInformation->id()); -} - -void KitAspectWidget::setMutable(bool b) -{ - m_kit->setMutable(m_kitInformation->id(), b); -} - QString KitAspectWidget::msgManage() { return tr("Manage..."); diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index 439a392ec47..6d7ef227425 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -135,8 +135,6 @@ public: virtual QWidget *buttonWidget() const { return nullptr; } bool isSticky() const { return m_isSticky; } - bool isMutable() const; - void setMutable(bool b); static QString msgManage(); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index fa699708b78..2923b7a6f77 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -232,12 +232,13 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(KitAspect *aspect) auto action = new QAction(tr("Mark as Mutable"), nullptr); action->setCheckable(true); - action->setChecked(widget->isMutable()); + action->setChecked(workingCopy()->isMutable(aspect->id())); + action->setEnabled(!widget->isSticky()); widget->mainWidget()->addAction(action); widget->mainWidget()->setContextMenuPolicy(Qt::ActionsContextMenu); - connect(action, &QAction::toggled, this, [this, widget, action] { - widget->setMutable(action->isChecked()); + connect(action, &QAction::toggled, this, [this, aspect, action] { + workingCopy()->setMutable(aspect->id(), action->isChecked()); emit dirty(); });