Only overwrite card in deck if UUID _and_ Number missing

This commit is contained in:
ZeldaZach 2024-12-01 17:12:36 -05:00
parent 050c86cee6
commit 7d42a43c87
No known key found for this signature in database
4 changed files with 39 additions and 19 deletions

View file

@ -156,12 +156,17 @@ AbstractDecklistNode *InnerDecklistNode::findChild(const QString &_name)
return nullptr;
}
AbstractDecklistNode *InnerDecklistNode::findCardChildByNameAndProviderId(const QString &_name,
const QString &_providerId)
AbstractDecklistNode *InnerDecklistNode::findCardChildByNameProviderIdAndNumber(const QString &_name,
const QString &_providerId,
const QString &_cardNumber)
{
for (int i = 0; i < size(); i++) {
if (at(i) != nullptr && at(i)->getName() == _name && at(i)->getCardProviderId() == _providerId) {
return at(i);
for (const auto &i : *this) {
if (i != nullptr && i->getName() == _name) {
if (i->getCardCollectorNumber() == _cardNumber) {
if (i->getCardProviderId() == _providerId) {
return i;
}
}
}
}
return nullptr;