[DeckList] Make deck tree card traversal recursive (#7175)

* [DeckList] Make deck tree card traversal recursive

getCardNodes and forEachCard now descend into nested zones instead of
assuming a flat main/side/token layout. For today's flat trees this is
behavior-preserving; it also removes two latent crashes (unchecked
dynamic_cast dereference, null card nodes passed to forEachCard
callers). Nested zones are introduced by later custom-zones units.

Took 3 minutes


Took 7 seconds

Took 9 seconds

* Fix rebase mistake.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-08-24 18:44:05 +02:00 committed by GitHub
parent 22b0f69706
commit b13c682a7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 28 deletions

View file

@ -718,20 +718,20 @@ UserListWidget::UserListWidget(TabSupervisor *_tabSupervisor,
}
});
// Section dividers can be collapsed/expanded by the user. Surface those
// changes only from real user interaction. Programmatic expansion is
// applied through setSectionExpanded() / setExpandedProgrammatically().
connect(userTree, &QTreeWidget::itemExpanded, this,
[this](QTreeWidgetItem *item) { handleSectionExpansion(item, true); });
connect(userTree, &QTreeWidget::itemCollapsed, this,
[this](QTreeWidgetItem *item) { handleSectionExpansion(item, false); });
// Section dividers can be collapsed/expanded by the user. Surface those
// changes only from real user interaction. Programmatic expansion is
// applied through setSectionExpanded() / setExpandedProgrammatically().
connect(userTree, &QTreeWidget::itemExpanded, this,
[this](QTreeWidgetItem *item) { handleSectionExpansion(item, true); });
connect(userTree, &QTreeWidget::itemCollapsed, this,
[this](QTreeWidgetItem *item) { handleSectionExpansion(item, false); });
// Hide popup when list scrolls (reference row has moved)
// Hide popup when list scrolls (reference row has moved)
connect(userTree->verticalScrollBar(), &QScrollBar::valueChanged, this, [this] {
showPopupTimer->stop();
hidePopup(true);
requestAvatarsForVisibleItems();
});
showPopupTimer->stop();
hidePopup(true);
requestVisibleItemResources();
});
// Forward join requests from popup upward
connect(userInfoPopup, &UserInfoPopup::joinGameRequested, this, &UserListWidget::joinGameRequested);
@ -746,7 +746,7 @@ UserListWidget::UserListWidget(TabSupervisor *_tabSupervisor,
// Keep the popup-less scroll path alive for avatar prefetch.
connect(userTree->verticalScrollBar(), &QScrollBar::valueChanged, this,
[this] { requestAvatarsForVisibleItems(); });
[this] { requestVisibleItemResources(); });
}
// Section dividers can be collapsed/expanded by the user. Surface those
@ -1541,9 +1541,9 @@ void UserListWidget::updateCount()
}
}
void UserListWidget::setShowTitle(bool showTitle)
void UserListWidget::setShowTitle(bool _showTitle)
{
this->showTitle = showTitle;
this->showTitle = _showTitle;
updateCount();
}