mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
clean up initializeFormats
This commit is contained in:
parent
fd75d83213
commit
ca6961c0b6
1 changed files with 3 additions and 4 deletions
|
|
@ -284,16 +284,15 @@ void DeckEditorDeckDockWidget::createDeckDock()
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::initializeFormats()
|
void DeckEditorDeckDockWidget::initializeFormats()
|
||||||
{
|
{
|
||||||
QMap<QString, int> allFormats = CardDatabaseManager::query()->getAllFormatsWithCount();
|
QStringList allFormats = CardDatabaseManager::query()->getAllFormatsWithCount().keys();
|
||||||
|
|
||||||
formatComboBox->clear(); // Remove "Loading Database..."
|
formatComboBox->clear(); // Remove "Loading Database..."
|
||||||
formatComboBox->setEnabled(true);
|
formatComboBox->setEnabled(true);
|
||||||
|
|
||||||
// Populate with formats
|
// Populate with formats
|
||||||
formatComboBox->addItem("", "");
|
formatComboBox->addItem("", "");
|
||||||
for (auto it = allFormats.constBegin(); it != allFormats.constEnd(); ++it) {
|
for (auto formatName : allFormats) {
|
||||||
QString displayText = QString("%1").arg(it.key());
|
formatComboBox->addItem(formatName, formatName); // store the raw key in itemData
|
||||||
formatComboBox->addItem(displayText, it.key()); // store the raw key in itemData
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!deckModel->getDeckList()->getGameFormat().isEmpty()) {
|
if (!deckModel->getDeckList()->getGameFormat().isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue