ProjectExplorer: Consolidate creation of KitAspect's "Manage..."

Change-Id: I001a21f41bcd5ff0614bdf98893b56137c06546f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2023-08-22 10:25:30 +02:00
parent 04eea22c5f
commit fc7c11fb65
10 changed files with 41 additions and 52 deletions

View File

@@ -120,10 +120,10 @@ private:
class CMakeKitAspectImpl final : public KitAspect
{
public:
CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *factory) : KitAspect(kit, factory),
m_comboBox(createSubWidget<QComboBox>()),
m_manageButton(createManageButton(Constants::Settings::TOOLS_ID))
CMakeKitAspectImpl(Kit *kit, const KitAspectFactory *factory)
: KitAspect(kit, factory), m_comboBox(createSubWidget<QComboBox>())
{
setManagingPage(Constants::Settings::TOOLS_ID);
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
m_comboBox->setEnabled(false);
m_comboBox->setToolTip(factory->description());
@@ -142,7 +142,6 @@ public:
~CMakeKitAspectImpl() override
{
delete m_comboBox;
delete m_manageButton;
}
private:
@@ -153,7 +152,6 @@ private:
{
addMutableAction(m_comboBox);
builder.addItem(m_comboBox);
builder.addItem(m_manageButton);
}
void refresh() override
@@ -213,7 +211,6 @@ private:
Guard m_ignoreChanges;
QComboBox *m_comboBox;
QWidget *m_manageButton;
};
CMakeKitAspectFactory::CMakeKitAspectFactory()