mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
Introduce null checks, add setShortName and collectorNumber to deckList export. (#5471)
* Introduce null checks, add setShortName and collectorNumber to deckList export. * Lint. * Lint again. * Lint AGAIN. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
c079715c46
commit
a717e715b6
1 changed files with 22 additions and 1 deletions
|
|
@ -254,6 +254,14 @@ struct FormatDeckListForExport
|
||||||
mainBoardCards += QString::number(card->getNumber());
|
mainBoardCards += QString::number(card->getNumber());
|
||||||
mainBoardCards += "%20";
|
mainBoardCards += "%20";
|
||||||
mainBoardCards += card->getName();
|
mainBoardCards += card->getName();
|
||||||
|
if (!card->getCardSetShortName().isNull()) {
|
||||||
|
mainBoardCards += "%20";
|
||||||
|
mainBoardCards += "(" + card->getCardSetShortName() + ")";
|
||||||
|
}
|
||||||
|
if (!card->getCardCollectorNumber().isNull()) {
|
||||||
|
mainBoardCards += "%20";
|
||||||
|
mainBoardCards += card->getCardCollectorNumber();
|
||||||
|
}
|
||||||
mainBoardCards += "%0A";
|
mainBoardCards += "%0A";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -419,7 +427,20 @@ void DeckLoader::saveToStream_DeckZoneCards(QTextStream &out,
|
||||||
out << "SB: ";
|
out << "SB: ";
|
||||||
}
|
}
|
||||||
|
|
||||||
out << card->getNumber() << " " << card->getName() << "\n";
|
if (card->getNumber()) {
|
||||||
|
out << card->getNumber();
|
||||||
|
}
|
||||||
|
if (!card->getName().isNull() && !card->getName().isEmpty()) {
|
||||||
|
out << " " << card->getName();
|
||||||
|
}
|
||||||
|
if (!card->getCardSetShortName().isNull() && !card->getCardSetShortName().isEmpty()) {
|
||||||
|
out << " "
|
||||||
|
<< "(" << card->getCardSetShortName() << ")";
|
||||||
|
}
|
||||||
|
if (!card->getCardCollectorNumber().isNull()) {
|
||||||
|
out << " " << card->getCardCollectorNumber();
|
||||||
|
}
|
||||||
|
out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue