Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardSetList Class Reference

A list-like container for CardSet objects with extended management methods. More...

#include <card_set_list.h>

Inheritance diagram for CardSetList:
[legend]
Collaboration diagram for CardSetList:
[legend]

Classes

class  KeyCompareFunctor
 Internal comparison functor for sorting by sort key. More...

Public Member Functions

void sortByKey ()
 Sorts the set list by each set’s assigned sort key.
void enableAllBatched (ICardSetPriorityController *controller)
 Enables every set with fresh sort keys, persisting in one flush.
void enableAllUnknownBatched (ICardSetPriorityController *controller)
 Enables all sets that are unknown or ignored, persisting in one flush.
void markAllAsKnownBatched (ICardSetPriorityController *controller)
 Marks all sets as known and adjusts their enabled state, persisting in one flush.
int getEnabledSetsNum ()
 Counts the number of sets that are currently enabled.
int getUnknownSetsNum ()
 Counts the number of sets that are currently unknown.
QStringList getUnknownSetsNames ()
 Collects the short names of all sets marked as unknown.
void defaultSort ()
 Sorts the list by default rules.

Detailed Description

A list-like container for CardSet objects with extended management methods.

Extends QList<CardSetPtr> by adding convenience operations for sorting, enabling/disabling sets, and tracking known/unknown status. Unlike a plain list, this container provides domain-specific functionality for handling groups of sets in bulk.

Member Function Documentation

◆ defaultSort()

void CardSetList::defaultSort ( )

Sorts the list by default rules.

Orders sets first by priority (ascending), then by release date (most recent first), and finally alphabetically by short name.

Here is the caller graph for this function:

◆ enableAllBatched()

void CardSetList::enableAllBatched ( ICardSetPriorityController * controller)

Enables every set with fresh sort keys, persisting in one flush.

Assigns sequential sort keys in default-sorted order and marks every set known and enabled, writing all records through the controller's batched saveSets() in a single settings flush instead of ~3 QSettings rewrite cycles per set, which froze the GUI thread for seconds on a first run with a full database.

Parameters
controllerThe set priority controller to persist the records with.
Here is the call graph for this function:

◆ enableAllUnknownBatched()

void CardSetList::enableAllUnknownBatched ( ICardSetPriorityController * controller)

Enables all sets that are unknown or ignored, persisting in one flush.

Sets that are not marked as known and not ignored are marked as known and enabled. Ignored-known sets are also enabled, but remain ignored. Only changed sets are written, so the common case of a few new sets costs a single settings flush no matter how large the database is.

Parameters
controllerThe set priority controller to persist the records with.
Here is the call graph for this function:

◆ getEnabledSetsNum()

int CardSetList::getEnabledSetsNum ( )

Counts the number of sets that are currently enabled.

Returns
Integer count of enabled sets.

◆ getUnknownSetsNames()

QStringList CardSetList::getUnknownSetsNames ( )

Collects the short names of all sets marked as unknown.

Returns
A list of unknown set names.

◆ getUnknownSetsNum()

int CardSetList::getUnknownSetsNum ( )

Counts the number of sets that are currently unknown.

Returns
Integer count of unknown sets.

◆ markAllAsKnownBatched()

void CardSetList::markAllAsKnownBatched ( ICardSetPriorityController * controller)

Marks all sets as known and adjusts their enabled state, persisting in one flush.

Unknown, non-ignored sets become known and disabled. Ignored-known sets are enabled if they were previously disabled. Only changed sets are written; when nothing is unknown no flush happens at all.

Parameters
controllerThe set priority controller to persist the records with.
Here is the call graph for this function:

◆ sortByKey()

void CardSetList::sortByKey ( )

Sorts the set list by each set’s assigned sort key.

Uses KeyCompareFunctor internally. If two sets share the same sort key, their relative order is unspecified.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: