remove expandAll calls

This commit is contained in:
RickyRister 2025-12-23 04:29:28 -08:00
parent 08e8d70e10
commit ac30d10cb1
4 changed files with 6 additions and 33 deletions

View file

@ -175,8 +175,6 @@ void DeckEditorDeckDockWidget::createDeckDock()
deckModel->setActiveGroupCriteria(static_cast<DeckListModelGroupCriteria::Type>(
activeGroupCriteriaComboBox->currentData(Qt::UserRole).toInt()));
deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder());
deckView->expandAll();
deckView->expandAll();
});
aIncrement = new QAction(QString(), this);
@ -506,7 +504,6 @@ void DeckEditorDeckDockWidget::syncDisplayWidgetsToModel()
bannerCardComboBox->blockSignals(false);
updateHash();
sortDeckModelToDeckView();
expandAll();
deckTagsDisplayWidget->setTags(deckModel->getDeckList()->getTags());
}
@ -516,8 +513,6 @@ void DeckEditorDeckDockWidget::sortDeckModelToDeckView()
deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder());
deckModel->setActiveFormat(deckModel->getDeckList()->getGameFormat());
formatComboBox->setCurrentIndex(formatComboBox->findData(deckModel->getDeckList()->getGameFormat()));
deckView->expandAll();
deckView->expandAll();
emit deckChanged();
}
@ -557,12 +552,6 @@ void DeckEditorDeckDockWidget::recursiveExpand(const QModelIndex &index)
deckView->expand(index);
}
void DeckEditorDeckDockWidget::expandAll()
{
deckView->expandAll();
deckView->expandAll();
}
/**
* Gets the index of all the currently selected card nodes in the decklist table.
* The list is in reverse order of the visual selection, so that rows can be deleted while iterating over them.
@ -600,7 +589,6 @@ void DeckEditorDeckDockWidget::actAddCard(const ExactCard &card, const QString &
return;
}
expandAll();
deckView->clearSelection();
deckView->setCurrentIndex(newCardIndex);
@ -677,11 +665,12 @@ bool DeckEditorDeckDockWidget::swapCard(const QModelIndex &currentIndex)
offsetCountAtIndex(currentIndex, -1);
const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN;
ExactCard card = CardDatabaseManager::query()->getCard({cardName, cardProviderID});
QModelIndex newCardIndex = card ? deckModel->addCard(card, otherZoneName)
// Third argument (true) says create the card no matter what, even if not in DB
: deckModel->addPreferredPrintingCard(cardName, otherZoneName, true);
recursiveExpand(proxy->mapFromSource(newCardIndex));
if (ExactCard card = CardDatabaseManager::query()->getCard({cardName, cardProviderID})) {
deckModel->addCard(card, otherZoneName);
} else {
// Third argument (true) says create the card no matter what, even if not in DB
deckModel->addPreferredPrintingCard(cardName, otherZoneName, true);
}
return true;
}

View file

@ -70,7 +70,6 @@ public slots:
void actSwapSelection();
void actRemoveCard();
void initializeFormats();
void expandAll();
signals:
void nameChanged();

View file

@ -175,7 +175,6 @@ void CardAmountWidget::addPrinting(const QString &zone)
// Add the card and expand the list UI
auto newCardIndex = deckModel->addCard(rootCard, zone);
recursiveExpand(newCardIndex);
// Check if a card without a providerId already exists in the deckModel and replace it, if so.
QString foundProviderId =
@ -229,19 +228,6 @@ void CardAmountWidget::removePrintingSideboard()
decrementCardHelper(DECK_ZONE_SIDE);
}
/**
* @brief Recursively expands the card in the deck view starting from the given index.
*
* @param index The model index of the card to expand.
*/
void CardAmountWidget::recursiveExpand(const QModelIndex &index)
{
if (index.parent().isValid()) {
recursiveExpand(index.parent());
}
deckView->expand(index);
}
/**
* @brief Offsets the card count at the specified index by the given amount.
*

View file

@ -59,7 +59,6 @@ private:
void offsetCountAtIndex(const QModelIndex &idx, int offset);
void decrementCardHelper(const QString &zoneName);
void recursiveExpand(const QModelIndex &index);
private slots:
void addPrintingMainboard();