mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 09:33:57 -07:00
remove expandAll calls
This commit is contained in:
parent
08e8d70e10
commit
ac30d10cb1
4 changed files with 6 additions and 33 deletions
|
|
@ -175,8 +175,6 @@ void DeckEditorDeckDockWidget::createDeckDock()
|
||||||
deckModel->setActiveGroupCriteria(static_cast<DeckListModelGroupCriteria::Type>(
|
deckModel->setActiveGroupCriteria(static_cast<DeckListModelGroupCriteria::Type>(
|
||||||
activeGroupCriteriaComboBox->currentData(Qt::UserRole).toInt()));
|
activeGroupCriteriaComboBox->currentData(Qt::UserRole).toInt()));
|
||||||
deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder());
|
deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder());
|
||||||
deckView->expandAll();
|
|
||||||
deckView->expandAll();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
aIncrement = new QAction(QString(), this);
|
aIncrement = new QAction(QString(), this);
|
||||||
|
|
@ -506,7 +504,6 @@ void DeckEditorDeckDockWidget::syncDisplayWidgetsToModel()
|
||||||
bannerCardComboBox->blockSignals(false);
|
bannerCardComboBox->blockSignals(false);
|
||||||
updateHash();
|
updateHash();
|
||||||
sortDeckModelToDeckView();
|
sortDeckModelToDeckView();
|
||||||
expandAll();
|
|
||||||
|
|
||||||
deckTagsDisplayWidget->setTags(deckModel->getDeckList()->getTags());
|
deckTagsDisplayWidget->setTags(deckModel->getDeckList()->getTags());
|
||||||
}
|
}
|
||||||
|
|
@ -516,8 +513,6 @@ void DeckEditorDeckDockWidget::sortDeckModelToDeckView()
|
||||||
deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder());
|
deckModel->sort(deckView->header()->sortIndicatorSection(), deckView->header()->sortIndicatorOrder());
|
||||||
deckModel->setActiveFormat(deckModel->getDeckList()->getGameFormat());
|
deckModel->setActiveFormat(deckModel->getDeckList()->getGameFormat());
|
||||||
formatComboBox->setCurrentIndex(formatComboBox->findData(deckModel->getDeckList()->getGameFormat()));
|
formatComboBox->setCurrentIndex(formatComboBox->findData(deckModel->getDeckList()->getGameFormat()));
|
||||||
deckView->expandAll();
|
|
||||||
deckView->expandAll();
|
|
||||||
|
|
||||||
emit deckChanged();
|
emit deckChanged();
|
||||||
}
|
}
|
||||||
|
|
@ -557,12 +552,6 @@ void DeckEditorDeckDockWidget::recursiveExpand(const QModelIndex &index)
|
||||||
deckView->expand(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.
|
* 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.
|
* 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
expandAll();
|
|
||||||
deckView->clearSelection();
|
deckView->clearSelection();
|
||||||
deckView->setCurrentIndex(newCardIndex);
|
deckView->setCurrentIndex(newCardIndex);
|
||||||
|
|
||||||
|
|
@ -677,11 +665,12 @@ bool DeckEditorDeckDockWidget::swapCard(const QModelIndex ¤tIndex)
|
||||||
offsetCountAtIndex(currentIndex, -1);
|
offsetCountAtIndex(currentIndex, -1);
|
||||||
const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN;
|
const QString otherZoneName = zoneName == DECK_ZONE_MAIN ? DECK_ZONE_SIDE : DECK_ZONE_MAIN;
|
||||||
|
|
||||||
ExactCard card = CardDatabaseManager::query()->getCard({cardName, cardProviderID});
|
if (ExactCard card = CardDatabaseManager::query()->getCard({cardName, cardProviderID})) {
|
||||||
QModelIndex newCardIndex = card ? deckModel->addCard(card, otherZoneName)
|
deckModel->addCard(card, otherZoneName);
|
||||||
// Third argument (true) says create the card no matter what, even if not in DB
|
} else {
|
||||||
: deckModel->addPreferredPrintingCard(cardName, otherZoneName, true);
|
// Third argument (true) says create the card no matter what, even if not in DB
|
||||||
recursiveExpand(proxy->mapFromSource(newCardIndex));
|
deckModel->addPreferredPrintingCard(cardName, otherZoneName, true);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ public slots:
|
||||||
void actSwapSelection();
|
void actSwapSelection();
|
||||||
void actRemoveCard();
|
void actRemoveCard();
|
||||||
void initializeFormats();
|
void initializeFormats();
|
||||||
void expandAll();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void nameChanged();
|
void nameChanged();
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,6 @@ void CardAmountWidget::addPrinting(const QString &zone)
|
||||||
|
|
||||||
// Add the card and expand the list UI
|
// Add the card and expand the list UI
|
||||||
auto newCardIndex = deckModel->addCard(rootCard, zone);
|
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.
|
// Check if a card without a providerId already exists in the deckModel and replace it, if so.
|
||||||
QString foundProviderId =
|
QString foundProviderId =
|
||||||
|
|
@ -229,19 +228,6 @@ void CardAmountWidget::removePrintingSideboard()
|
||||||
decrementCardHelper(DECK_ZONE_SIDE);
|
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.
|
* @brief Offsets the card count at the specified index by the given amount.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ private:
|
||||||
|
|
||||||
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
||||||
void decrementCardHelper(const QString &zoneName);
|
void decrementCardHelper(const QString &zoneName);
|
||||||
void recursiveExpand(const QModelIndex &index);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addPrintingMainboard();
|
void addPrintingMainboard();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue