The list model backing the Visual Deck Storage widget tree.
More...
#include <visual_deck_storage_model.h>
|
| void | deckLoaded (int row) |
| | Emitted when a deck file finishes loading.
|
| void | deckFilePathChanged (const QString &oldFilePath, const QString &newFilePath) |
| | Emitted when a deck's file path changes (rename file, conversion).
|
The list model backing the Visual Deck Storage widget tree.
Rows are in filesystem scan order; ordering and filtering are handled by VisualDeckStorageSortFilterProxyModel on top of this model. The proxy keeps every row and exposes each row's filter result through its FilterMatchRole.
◆ VisualDeckStorageModel()
| VisualDeckStorageModel::VisualDeckStorageModel |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ beginLoad()
| void VisualDeckStorageModel::beginLoad |
( |
int | row | ) |
|
|
private |
◆ convertToCockatriceFormat()
| bool VisualDeckStorageModel::convertToCockatriceFormat |
( |
int | row | ) |
|
◆ data()
| QVariant VisualDeckStorageModel::data |
( |
const QModelIndex & | index, |
|
|
int | role ) const |
|
nodiscardoverride |
◆ dataForRow()
| const DeckPreviewData & VisualDeckStorageModel::dataForRow |
( |
int | row | ) |
const |
|
nodiscard |
◆ deckFilePathChanged
| void VisualDeckStorageModel::deckFilePathChanged |
( |
const QString & | oldFilePath, |
|
|
const QString & | newFilePath ) |
|
signal |
Emitted when a deck's file path changes (rename file, conversion).
- Parameters
-
| oldFilePath | The previous file path. |
| newFilePath | The new file path. |
◆ deckForRow()
| const LoadedDeck & VisualDeckStorageModel::deckForRow |
( |
int | row | ) |
const |
|
nodiscard |
◆ deckLoaded
| void VisualDeckStorageModel::deckLoaded |
( |
int | row | ) |
|
|
signal |
Emitted when a deck file finishes loading.
- Parameters
-
| row | The row of the deck that finished loading. |
◆ deleteFile()
| bool VisualDeckStorageModel::deleteFile |
( |
int | row | ) |
|
◆ drainPendingLoads
| void VisualDeckStorageModel::drainPendingLoads |
( |
| ) |
|
|
privateslot |
◆ getDeckPath()
| QString VisualDeckStorageModel::getDeckPath |
( |
| ) |
const |
|
inlinenodiscard |
◆ getFolderPaths()
| QStringList VisualDeckStorageModel::getFolderPaths |
( |
| ) |
const |
|
inlinenodiscard |
The relative paths of all subdirectories of the deck folder, one level at a time. Used by the view to build the folder tree. Sorted for deterministic order.
◆ recomputeDeckMetadata()
| void VisualDeckStorageModel::recomputeDeckMetadata |
( |
DeckPreviewData & | data, |
|
|
bool | recomputeColorIdentity = true ) |
|
staticprivate |
Recomputes all derived metadata of a row from its loaded deck.
◆ refresh()
| void VisualDeckStorageModel::refresh |
( |
| ) |
|
Re-scans the current deck folder, reloading every deck file.
◆ reindexFilePaths()
| void VisualDeckStorageModel::reindexFilePaths |
( |
| ) |
|
|
private |
Rebuilds the file path -> row index from scratch after bulk changes.
◆ reloadIfModified()
| bool VisualDeckStorageModel::reloadIfModified |
( |
int | row | ) |
|
◆ renameDeck()
| bool VisualDeckStorageModel::renameDeck |
( |
int | row, |
|
|
const QString & | newName ) |
◆ renameFile()
| bool VisualDeckStorageModel::renameFile |
( |
int | row, |
|
|
const QString & | newBaseName ) |
◆ rowCount()
| int VisualDeckStorageModel::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
nodiscardoverride |
◆ rowForFilePath()
| int VisualDeckStorageModel::rowForFilePath |
( |
const QString & | filePath | ) |
const |
|
nodiscard |
◆ schedulePendingLoadDrain()
| void VisualDeckStorageModel::schedulePendingLoadDrain |
( |
| ) |
|
|
private |
◆ setBannerCard()
| bool VisualDeckStorageModel::setBannerCard |
( |
int | row, |
|
|
const CardRef & | cardRef ) |
◆ setDeckPath()
| void VisualDeckStorageModel::setDeckPath |
( |
const QString & | path | ) |
|
Sets the folder to scan for deck files and starts (re)loading. Clears the model immediately (modelReset), then populates it asynchronously as the background scan discovers deck files.
◆ setFilePathForRow()
| void VisualDeckStorageModel::setFilePathForRow |
( |
int | row, |
|
|
const QString & | newFilePath ) |
|
private |
◆ setTags()
| bool VisualDeckStorageModel::setTags |
( |
int | row, |
|
|
const QStringList & | tags ) |
◆ startScan()
| void VisualDeckStorageModel::startScan |
( |
| ) |
|
|
private |
◆ deckPath
| QString VisualDeckStorageModel::deckPath |
|
private |
◆ decks
◆ drainScheduled
| bool VisualDeckStorageModel::drainScheduled = false |
|
private |
Whether a queued drain pass is already pending.
◆ folderPaths
| QStringList VisualDeckStorageModel::folderPaths |
|
private |
All subdirectories of the deck folder, sorted.
◆ pendingLoads
Finished background loads waiting to be applied.
◆ rowByFilePath
| QHash<QString, int> VisualDeckStorageModel::rowByFilePath |
|
private |
Maps each deck's file path to its row for O(1) lookups.
◆ scanGeneration
| int VisualDeckStorageModel::scanGeneration = 0 |
|
private |
Bumped on every scan so stale results are ignored.
The documentation for this class was generated from the following files: