From ca6961c0b664237c9b89797ec2501f795c50d728 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sun, 28 Dec 2025 01:47:33 -0800 Subject: [PATCH] clean up initializeFormats --- .../widgets/deck_editor/deck_editor_deck_dock_widget.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp b/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp index 8ded2c50a..409d43e64 100644 --- a/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp +++ b/cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp @@ -284,16 +284,15 @@ void DeckEditorDeckDockWidget::createDeckDock() void DeckEditorDeckDockWidget::initializeFormats() { - QMap 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()) {