Remember how many cards were originally in deck when replacing with uuid version.

This commit is contained in:
Lukas Brübach 2024-12-06 03:04:16 +01:00 committed by ZeldaZach
parent 7f22d48a5e
commit 7bc34619c1
No known key found for this signature in database

View file

@ -91,6 +91,12 @@ void CardAmountWidget::addPrinting(const QString &zone)
recursiveExpand(newCardIndex);
QModelIndex find_card = deckModel->findCard(rootCard->getName(), zone);
if (find_card.isValid() && find_card != newCardIndex) {
auto amount = deckModel->data(find_card, Qt::DisplayRole);
if (amount.toInt() > 1) {
for (int i = 0; i < amount.toInt() - 1; i++) {
deckModel->addCard(rootCard->getName(), setInfoForCard, zone);
}
}
deckModel->removeRow(find_card.row(), find_card.parent());
};
newCardIndex = deckModel->findCard(rootCard->getName(), zone, setInfoForCard.getProperty("uuid"));