From 45e3fa16213bea855bb6ec9abe22f1932ebffb23 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 21 Aug 2023 18:32:33 +0200 Subject: [PATCH] ProjectExplorer: Simplify KitAspect::addToLayoutWithLabel() The parent widget was not used anymore. Change-Id: I57bb024b770c01efc68bb722623bcc7fb565cfeb Reviewed-by: Christian Stenger --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 6 +++--- src/plugins/projectexplorer/kitmanager.cpp | 3 +-- src/plugins/projectexplorer/kitmanager.h | 2 +- src/plugins/projectexplorer/kitmanagerconfigwidget.cpp | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 23a46e7100e..a6be87fd968 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -651,13 +651,13 @@ void CMakeBuildSettingsWidget::kitCMakeConfiguration() Layouting::Grid grid; KitAspect *widget = CMakeKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid, dialog); + widget->addToLayoutWithLabel(grid); widget = CMakeGeneratorKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid, dialog); + widget->addToLayoutWithLabel(grid); widget = CMakeConfigurationKitAspect::createKitAspect(m_buildConfig->kit()); widget->setParent(dialog); - widget->addToLayoutWithLabel(grid, dialog); + widget->addToLayoutWithLabel(grid); grid.attachTo(dialog); auto layout = qobject_cast(dialog->layout()); diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 30a70abfbe7..9685f35c2e9 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -734,9 +734,8 @@ KitAspect::~KitAspect() delete m_mutableAction; } -void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent) +void KitAspect::addToLayoutWithLabel(Layouting::LayoutItem &parentItem) { - QTC_ASSERT(parent, return); auto label = createSubWidget(m_factory->displayName() + ':'); label->setToolTip(m_factory->description()); connect(label, &QLabel::linkActivated, this, [this](const QString &link) { diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index c3774cfe79b..db11d3afb94 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -113,7 +113,7 @@ public: virtual void makeReadOnly() = 0; virtual void refresh() = 0; - void addToLayoutWithLabel(Layouting::LayoutItem &parentItem, QWidget *parent); + void addToLayoutWithLabel(Layouting::LayoutItem &parentItem); static QString msgManage(); diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index 9aa111bd693..98b14cee309 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -201,7 +201,7 @@ void KitManagerConfigWidget::addAspectToWorkingCopy(Layouting::LayoutItem &paren QTC_ASSERT(aspect, return); QTC_ASSERT(!m_kitAspects.contains(aspect), return); - aspect->addToLayoutWithLabel(parent, this); + aspect->addToLayoutWithLabel(parent); m_kitAspects.append(aspect); connect(aspect->mutableAction(), &QAction::toggled,