![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
Flat, read-only list of the public decks published by another user. More...
#include <remote_public_decks_model.h>
Classes | |
| struct | DeckEntry |
Public Types | |
| using | FilterMode = VisualDeckStorageSortFilterProxyModel::FilterMode |
| The color identity filter mode, shared with the Visual Deck Storage. | |
Signals | |
| void | loadingChanged (bool loading) |
| Emitted when a refresh starts, completes, or fails (see loading()). | |
| void | loadFailed (const QString &message) |
| Emitted when the last refresh failed; contains a user-facing message. | |
Public Member Functions | |
| RemotePublicDecksModel (AbstractClient *client, QObject *parent=nullptr) | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| void | refresh (const QString &userName) |
| Fetches the public decks of another user, replacing the current contents. | |
| void | clear () |
| void | setSearchText (const QString &text) |
| Sets a case-insensitive substring filter on the deck name. | |
| void | setColorFilter (FilterMode mode, const QSet< QChar > &colors) |
| Sets the active color identity filter and mode. | |
| void | setTagFilter (const QSet< QString > &selected, const QSet< QString > &excluded) |
| Filters decks by required (selected) and forbidden (excluded) tags. | |
| QSet< QString > | allTags () const |
| All tags present across all loaded decks, for building filter chips. | |
| int | filteredCount () const |
| The number of decks after filtering. | |
| int | totalCount () const |
| The number of decks before filtering. | |
| bool | isLoading () const |
| True while a refresh request is in flight and the grid has no data yet. | |
| DeckEntry | entryAt (int row) const |
Private Slots | |
| void | decksReceived (const Response &response, const CommandContainer &commandContainer) |
| void | onLoadingTimeout () |
Private Member Functions | |
| void | addFolder (const ServerInfo_DeckStorage_Folder &folder) |
| void | addTreeItem (const ServerInfo_DeckStorage_TreeItem &item) |
| void | rebuildVisibleIndices () |
| void | setLoading (bool value) |
Private Attributes | |
| AbstractClient * | client |
| QTimer * | loadingTimeoutTimer |
| QList< DeckEntry > | decks |
| QList< int > | visibleIndices |
| Row indices into decks that pass the current filters. | |
| bool | loading = false |
| int | requestSequence = 0 |
| Monotonically increases per refresh; only the newest request may update the grid. | |
| QString | searchText |
| VisualDeckStorageSortFilterProxyModel::FilterMode | colorFilterMode = VisualDeckStorageSortFilterProxyModel::Includes |
| QSet< QChar > | activeColors |
| QSet< QString > | includedTags |
| QSet< QString > | excludedTags |
Flat, read-only list of the public decks published by another user.
Fetches the target user's public decks via Command_DeckListOtherUser and flattens the response tree into entries carrying the preview metadata stored on the server (banner card name/provider and color identity). No deck list is downloaded until the user actually opens a deck.
Name and color-identity filtering is applied against this metadata, mirroring the Visual Deck Storage's filter semantics, so the grid can be narrowed like the local deck storage.
The color identity filter mode, shared with the Visual Deck Storage.
|
explicit |
|
private |
|
private |
|
nodiscard |
All tags present across all loaded decks, for building filter chips.
| void RemotePublicDecksModel::clear | ( | ) |
|
nodiscardoverride |
|
privateslot |
|
nodiscard |
|
inlinenodiscard |
The number of decks after filtering.
|
inlinenodiscard |
True while a refresh request is in flight and the grid has no data yet.
|
signal |
Emitted when the last refresh failed; contains a user-facing message.
|
signal |
Emitted when a refresh starts, completes, or fails (see loading()).
|
privateslot |
|
private |
| void RemotePublicDecksModel::refresh | ( | const QString & | userName | ) |
Fetches the public decks of another user, replacing the current contents.
|
nodiscardoverride |
| void RemotePublicDecksModel::setColorFilter | ( | VisualDeckStorageSortFilterProxyModel::FilterMode | mode, |
| const QSet< QChar > & | colors ) |
Sets the active color identity filter and mode.
|
private |
| void RemotePublicDecksModel::setSearchText | ( | const QString & | text | ) |
Sets a case-insensitive substring filter on the deck name.
| void RemotePublicDecksModel::setTagFilter | ( | const QSet< QString > & | selected, |
| const QSet< QString > & | excluded ) |
Filters decks by required (selected) and forbidden (excluded) tags.
|
inlinenodiscard |
The number of decks before filtering.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Monotonically increases per refresh; only the newest request may update the grid.
|
private |
|
private |
Row indices into decks that pass the current filters.