Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting.

This commit is contained in:
Lukas Brübach 2024-11-13 14:33:38 +01:00
parent 9d1f0e6067
commit f7fa8521b7

View file

@ -1029,6 +1029,7 @@ void TabDeckEditor::actSwapCard()
if (!currentIndex.isValid())
return;
const QString cardName = currentIndex.sibling(currentIndex.row(), 1).data().toString();
const QString cardUUID = currentIndex.sibling(currentIndex.row(), 2).data().toString();
const QModelIndex gparent = currentIndex.parent().parent();
if (!gparent.isValid())
@ -1038,8 +1039,9 @@ void TabDeckEditor::actSwapCard()
actDecrement();
const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN;
// Third argument (true) says create the card no mater what, even if not in DB
QModelIndex newCardIndex = deckModel->addPreferredPrintingCard(cardName, otherZoneName, true);
// Third argument (true) says create the card no matter what, even if not in DB
QModelIndex newCardIndex = deckModel->addCard(
cardName, CardDatabaseManager::getInstance()->getSpecificSetForCard(cardName, cardUUID), otherZoneName, true);
recursiveExpand(newCardIndex);
setModified(true);