[Refactor] Clean up some PrintingSelector widgets (#6451)

* remove currentZone from PrintingSelector

* don't store constructor args in fields if they're just passed

* simplify some methods

* refactor

* clean up initializeFormats

* more refactoring in CardAmountWidget
This commit is contained in:
RickyRister 2025-12-29 03:03:44 -08:00 committed by GitHub
parent ca3f6bba02
commit 96c82a0377
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 92 additions and 110 deletions

View file

@ -284,16 +284,15 @@ void DeckEditorDeckDockWidget::createDeckDock()
void DeckEditorDeckDockWidget::initializeFormats()
{
QMap<QString, int> allFormats = CardDatabaseManager::query()->getAllFormatsWithCount();
QStringList allFormats = CardDatabaseManager::query()->getAllFormatsWithCount().keys();
formatComboBox->clear(); // Remove "Loading Database..."
formatComboBox->setEnabled(true);
// Populate with formats
formatComboBox->addItem("", "");
for (auto it = allFormats.constBegin(); it != allFormats.constEnd(); ++it) {
QString displayText = QString("%1").arg(it.key());
formatComboBox->addItem(displayText, it.key()); // store the raw key in itemData
for (auto formatName : allFormats) {
formatComboBox->addItem(formatName, formatName); // store the raw key in itemData
}
if (!deckModel->getDeckList()->getGameFormat().isEmpty()) {