[DeckListModel] Consolidate methods and signals for card change (#6466)

This commit is contained in:
RickyRister 2026-01-05 09:28:59 -08:00 committed by GitHub
parent 85c9d8a9ff
commit 192dac0396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 86 additions and 6 deletions

View file

@ -154,7 +154,7 @@ void DeckEditorDeckDockWidget::createDeckDock()
bannerCardLabel->setText(tr("Banner Card"));
bannerCardLabel->setHidden(!SettingsCache::instance().getDeckEditorBannerCardComboBoxVisible());
bannerCardComboBox = new QComboBox(this);
connect(getModel(), &DeckListModel::dataChanged, this, [this]() {
connect(getModel(), &DeckListModel::cardNodesChanged, this, [this]() {
// Delay the update to avoid race conditions
QTimer::singleShot(100, this, &DeckEditorDeckDockWidget::updateBannerCardComboBox);
});

View file

@ -11,8 +11,7 @@ DeckStateManager::DeckStateManager(QObject *parent)
setModified(true);
emit historyChanged();
});
connect(deckListModel, &DeckListModel::rowsInserted, this, &DeckStateManager::uniqueCardsChanged);
connect(deckListModel, &DeckListModel::rowsRemoved, this, &DeckStateManager::uniqueCardsChanged);
connect(deckListModel, &DeckListModel::cardNodesChanged, this, &DeckStateManager::uniqueCardsChanged);
}
const DeckList &DeckStateManager::getDeckList() const