From e2835c2e5a7c57d07253a62be97bedcc0f1c54b5 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Wed, 3 Jun 2026 10:09:58 -0700 Subject: [PATCH] fix cardInfoRequest --- .../deck_editor/deck_editor_database_display_widget.cpp | 7 ++++--- .../deck_editor/deck_editor_database_display_widget.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp index 731a8d08a..50ff8851f 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.cpp @@ -222,10 +222,11 @@ void DeckEditorDatabaseDisplayWidget::databaseCustomMenu(QPoint point) } else { for (const CardRelation *rel : relatedCards) { const QString &relatedCardName = rel->getName(); - ExactCard exactCard = CardDatabaseManager::query()->getPreferredCard(relatedCardName); QAction *relatedCard = relatedMenu->addAction(relatedCardName); - connect(relatedCard, &QAction::triggered, this, - [this, exactCard] { emit cardInfoRequested(exactCard); }); + connect(relatedCard, &QAction::triggered, this, [this, relatedCardName] { + ExactCard card = CardDatabaseManager::query()->guessCard({relatedCardName}); + emit cardInfoRequested(card); + }); } } menu.exec(databaseView->mapToGlobal(point)); diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h index 4ffcde142..e36037bbb 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_database_display_widget.h @@ -54,7 +54,7 @@ signals: void edhrecRequested(const CardInfoPtr &cardInfo, bool isCommander); void printingSelectorRequested(); - void cardInfoRequested(const ExactCard &cardName); + void cardInfoRequested(const ExactCard &card); private: KeySignals searchKeySignals;