diff options
author | hjk <[email protected]> | 2025-05-27 15:25:24 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2025-05-28 14:49:06 +0000 |
commit | 69c86b3cf646a176b54af1fabb12e39da2c4262d (patch) | |
tree | 2d5aa3b80199d323f17c9c07923d1b074f9da60e | |
parent | 55fce29ba6e1f987308a30e3b88bf2a5fb6a8a54 (diff) |
Moving the relevant connects from TargetGroupItem to its
parent ProjectItem avoids the need to use parent() and
can trigger announceChange() directly.
Change-Id: Ife0371f44f13f7beebc2640e11767429285617c5
Reviewed-by: Christian Kandeler <[email protected]>
-rw-r--r-- | src/plugins/projectexplorer/projectwindow.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index b68185fdfa2..62bf4646f0d 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -611,6 +611,14 @@ public: &m_guard, [this] { m_vanishedTargetsItem->rebuild(); }, Qt::QueuedConnection /* this is triggered by a child item, so queue */); + + QObject::connect(project, &Project::removedTarget, &m_guard, [this] { + announceChange(); + }); + + QObject::connect(project, &Project::activeTargetChanged, &m_guard, [this] { + announceChange(); + }); } QVariant data(int column, int role) const final @@ -1062,15 +1070,6 @@ TargetGroupItem::TargetGroupItem(Project *project) { QObject::connect(project, &Project::addedTarget, &m_guard, [this] { update(); }); - QObject::connect(project, &Project::removedTarget, &m_guard, [this] { - QTC_ASSERT(parent(), return); - parent()->itemDeactivatedFromBelow(); - }); - - QObject::connect(project, &Project::activeTargetChanged, &m_guard, [this] { - parent()->itemActivatedFromBelow(this); - }); - // force a signal since the index has changed QObject::connect(KitManager::instance(), &KitManager::kitAdded, &m_guard, [this](Kit *kit) { appendChild(new TargetItem(m_project, kit->id(), m_project->projectIssues(kit))); |