![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <visual_deck_storage_folder_display_widget.h>
Public Slots | |
| void | reconcile () |
| Starts a new chunked reconcile pass that re-reads the proxy and rebuilds the deck previews and subfolder widgets to match. | |
| void | scheduleReconcile () |
| Coalesces proxy change signals (a burst of deck loads or filter invalidations) into a single reconcile on the next event loop turn. | |
| void | updateShowFolders (bool enabled) |
| void | setShareSelectable (bool selectable) |
Signals | |
| void | contentVisibilityChanged () |
| Emitted whenever this folder's visible content changes, so parent folders can re-evaluate their own visibility. | |
Public Member Functions | |
| VisualDeckStorageFolderDisplayWidget (QWidget *parent, VisualDeckStorageWidget *visualDeckStorageWidget, const QString &folderPath, bool canBeHidden, bool showFolders) | |
Private Member Functions | |
| void | beginDeckPass () |
| void | continueDeckPass () |
| void | finishDeckPass () |
| DeckPreviewWidget * | createDeckPreviewWidget (const QString &filePath) |
| Creates a deck preview widget and wires it up to the storage widget. | |
| void | createSubFolderWidgets () |
| Creates, removes and keeps in sync the subfolder widgets of this folder. | |
| void | refreshVisibility () |
| Hides the folder when it contains nothing visible, and reports the change upward. | |
| bool | hasContent () const |
| Whether this folder shows any deck previews or has any visible subfolder. | |
| QStringList | childFolderPaths () const |
| The direct child folder paths of this folder, sorted by name. | |
Private Attributes | |
| bool | showFolders |
| QString | folderPath |
| Path relative to the deck folder, empty for the root folder. | |
| int | visibleDeckCount = 0 |
| The number of this folder's deck previews not filtered out. | |
| QVBoxLayout * | layout |
| QWidget * | container |
| QVBoxLayout * | containerLayout |
| FlowWidget * | flowWidget |
| BannerWidget * | header |
| VisualDeckStorageWidget * | visualDeckStorageWidget |
| QHash< QString, DeckPreviewWidget * > | deckWidgets |
| Deck file path -> preview widget. | |
| QHash< QString, VisualDeckStorageFolderDisplayWidget * > | subFolderWidgets |
| Folder path -> subfolder widget. | |
| QTimer * | reconcileTimer = nullptr |
| Coalesces proxy change bursts. | |
| QStringList | lastOrderedFilePaths |
| The deck order last applied to the flow layout. | |
| bool | deckPassActive = false |
| Whether a chunked reconcile pass is currently running. | |
| bool | deckPassRestartRequested = false |
| bool | initialPassCompleted = false |
| Whether the first reconcile pass has run to completion at least once. | |
| int | deckPassRow = 0 |
| Next proxy row to scan in the active pass. | |
| QSet< QString > | deckPassPresentPaths |
| File paths seen so far in the active pass. | |
Static Private Attributes | |
| static constexpr int | DECK_PASS_TIME_BUDGET_MS = 20 |
| The maximum time in milliseconds spent creating deck previews per event loop turn. | |
| VisualDeckStorageFolderDisplayWidget::VisualDeckStorageFolderDisplayWidget | ( | QWidget * | parent, |
| VisualDeckStorageWidget * | visualDeckStorageWidget, | ||
| const QString & | folderPath, | ||
| bool | canBeHidden, | ||
| bool | showFolders ) |
|
private |
|
nodiscardprivate |
The direct child folder paths of this folder, sorted by name.
|
signal |
Emitted whenever this folder's visible content changes, so parent folders can re-evaluate their own visibility.
|
private |
|
nodiscardprivate |
Creates a deck preview widget and wires it up to the storage widget.
| filePath | The absolute path of the deck file to preview. |
|
private |
Creates, removes and keeps in sync the subfolder widgets of this folder.
Only direct child folders are created here; each child manages its own children, mirroring the folder tree on disk.
|
private |
|
nodiscardprivate |
Whether this folder shows any deck previews or has any visible subfolder.
While the first pass is still building, the folder counts as having content so it doesn't flicker or hide prematurely before its previews have been created.
|
slot |
Starts a new chunked reconcile pass that re-reads the proxy and rebuilds the deck previews and subfolder widgets to match.
Starts a new chunked scan of the source model, yielding to the event loop between chunks.
|
private |
Hides the folder when it contains nothing visible, and reports the change upward.
|
slot |
Coalesces proxy change signals (a burst of deck loads or filter invalidations) into a single reconcile on the next event loop turn.
|
slot |
|
slot |
|
private |
|
private |
|
staticconstexprprivate |
The maximum time in milliseconds spent creating deck previews per event loop turn.
Creating all previews of a large folder at once blocks the ui thread for hundreds of milliseconds, so the pass is split into chunks that yield to the event loop instead.
|
private |
Whether a chunked reconcile pass is currently running.
|
private |
File paths seen so far in the active pass.
|
private |
Set when the model changes mid-pass. Discards progress and restarts the scan once the current chunk finishes so the pass always converges on the latest model state.
|
private |
Next proxy row to scan in the active pass.
|
private |
Deck file path -> preview widget.
|
private |
|
private |
Path relative to the deck folder, empty for the root folder.
|
private |
|
private |
Whether the first reconcile pass has run to completion at least once.
|
private |
The deck order last applied to the flow layout.
|
private |
|
private |
Coalesces proxy change bursts.
|
private |
|
private |
Folder path -> subfolder widget.
|
private |
The number of this folder's deck previews not filtered out.
|
private |