Introduce null checks, add setShortName and collectorNumber to deckList export. (#5471)
Some checks failed
Build Desktop / Configure (push) Waiting to run
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, 12) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 11) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, 41) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, skip, 40) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, 24.04) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 20.04) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 22.04) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (yes, Arch, skip) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-14, Apple, 14, Release, 15.4) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-15, Apple, 15, Release, 16.2) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, macos-15, Apple, 15, Debug, 16.2) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (4, 1, macos-13, Intel, 13, Release, 14.3.1) (push) Blocked by required conditions
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, 5.15.*, 7) (push) Blocked by required conditions
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, qtimageformats qtmultimedia qtwebsockets, 6.6.*, 10) (push) Blocked by required conditions
Update Translations / Pull languages (push) Has been cancelled

* 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:
BruebachL 2025-01-14 16:54:15 +01:00 committed by GitHub
parent c079715c46
commit a717e715b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -254,6 +254,14 @@ struct FormatDeckListForExport
mainBoardCards += QString::number(card->getNumber());
mainBoardCards += "%20";
mainBoardCards += card->getName();
if (!card->getCardSetShortName().isNull()) {
mainBoardCards += "%20";
mainBoardCards += "(" + card->getCardSetShortName() + ")";
}
if (!card->getCardCollectorNumber().isNull()) {
mainBoardCards += "%20";
mainBoardCards += card->getCardCollectorNumber();
}
mainBoardCards += "%0A";
}
}
@ -419,7 +427,20 @@ void DeckLoader::saveToStream_DeckZoneCards(QTextStream &out,
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";
}
}