fix cardInfoRequest

This commit is contained in:
RickyRister 2026-06-03 10:09:58 -07:00
parent 26319d69a6
commit e2835c2e5a
2 changed files with 5 additions and 4 deletions

View file

@ -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));

View file

@ -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;