forked from qt-creator/qt-creator
ProjectExplore: Inline KitAspectWidget::{is,set}Mutable
... into its only user. Less indirection, less code. Change-Id: I8aa750c5850dff92c847eda8c2d6403cc3063f2d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -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...");
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user