Adjust to namespace.

Took 4 minutes

Took 1 minute
This commit is contained in:
Lukas Brübach 2025-11-10 13:18:21 +01:00
parent 5bf00d8735
commit 82dd4c08e7
3 changed files with 6 additions and 6 deletions

View file

@ -117,8 +117,8 @@ void DeckEditorDeckDockWidget::createDeckDock()
activeGroupCriteriaComboBox->addItem(tr("Mana Cost"), DeckListModelGroupCriteria::MANA_COST); activeGroupCriteriaComboBox->addItem(tr("Mana Cost"), DeckListModelGroupCriteria::MANA_COST);
activeGroupCriteriaComboBox->addItem(tr("Colors"), DeckListModelGroupCriteria::COLOR); activeGroupCriteriaComboBox->addItem(tr("Colors"), DeckListModelGroupCriteria::COLOR);
connect(activeGroupCriteriaComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this]() { connect(activeGroupCriteriaComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this]() {
deckModel->setActiveGroupCriteria( deckModel->setActiveGroupCriteria(static_cast<DeckListModelGroupCriteria::Type>(
static_cast<DeckListModelGroupCriteria>(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();
deckView->expandAll(); deckView->expandAll();

View file

@ -521,7 +521,7 @@ void DeckListModel::sort(int column, Qt::SortOrder order)
emit layoutChanged(); emit layoutChanged();
} }
void DeckListModel::setActiveGroupCriteria(DeckListModelGroupCriteria newCriteria) void DeckListModel::setActiveGroupCriteria(DeckListModelGroupCriteria::Type newCriteria)
{ {
activeGroupCriteria = newCriteria; activeGroupCriteria = newCriteria;
rebuildTree(); rebuildTree();

View file

@ -68,7 +68,7 @@ namespace DeckListModelGroupCriteria
* @enum DeckListModelGroupCriteria * @enum DeckListModelGroupCriteria
* @brief Available grouping strategies for deck visualization. * @brief Available grouping strategies for deck visualization.
*/ */
enum enum Type
{ {
MAIN_TYPE, /**< Group cards by their main type (e.g., creature, instant). */ MAIN_TYPE, /**< Group cards by their main type (e.g., creature, instant). */
MANA_COST, /**< Group cards by their total mana cost. */ MANA_COST, /**< Group cards by their total mana cost. */
@ -283,12 +283,12 @@ public:
* @brief Sets the criteria used to group cards in the model. * @brief Sets the criteria used to group cards in the model.
* @param newCriteria The new grouping criteria. * @param newCriteria The new grouping criteria.
*/ */
void setActiveGroupCriteria(DeckListModelGroupCriteria newCriteria); void setActiveGroupCriteria(DeckListModelGroupCriteria::Type newCriteria);
private: private:
DeckList *deckList; /**< Pointer to the deck loader providing the underlying data. */ DeckList *deckList; /**< Pointer to the deck loader providing the underlying data. */
InnerDecklistNode *root; /**< Root node of the model tree. */ InnerDecklistNode *root; /**< Root node of the model tree. */
DeckListModelGroupCriteria activeGroupCriteria = DeckListModelGroupCriteria::MAIN_TYPE; DeckListModelGroupCriteria::Type activeGroupCriteria = DeckListModelGroupCriteria::MAIN_TYPE;
int lastKnownColumn; /**< Last column used for sorting. */ int lastKnownColumn; /**< Last column used for sorting. */
Qt::SortOrder lastKnownOrder; /**< Last known sort order. */ Qt::SortOrder lastKnownOrder; /**< Last known sort order. */