Standardize Doxygen documentation style to @brief format

Convert leading triple-slash (///) comments to JavaDoc-style
    (/** @brief */) documentation blocks across game, deck list, and
    card library modules.

    - Leading /// comments → /** @brief ... */
    - Enum value comments → ///<
    - Trailing ///< member comments are unchanged
This commit is contained in:
DawnFire42 2026-05-13 12:56:22 -04:00
parent 0549892092
commit f361cd65e0
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
26 changed files with 207 additions and 177 deletions

View file

@ -64,8 +64,13 @@ ShortcutsSettings::ShortcutsSettings(const QString &settingsPath, QObject *paren
} }
} }
/// PR 5079 changes Textbox/unfocusTextBox to Player/unfocusTextBox and tab_game/aFocusChat to Player/aFocusChat. /**
/// A migration is necessary to let players keep their already configured shortcuts. * @brief Migrates legacy shortcut key names to current naming scheme.
*
* PR 5079 changed Textbox/unfocusTextBox to Player/unfocusTextBox and
* tab_game/aFocusChat to Player/aFocusChat. This migration allows players
* to keep their already configured shortcuts.
*/
void ShortcutsSettings::migrateShortcuts() void ShortcutsSettings::migrateShortcuts()
{ {
if (QFile(settingsFilePath).exists()) { if (QFile(settingsFilePath).exists()) {
@ -236,9 +241,7 @@ bool ShortcutsSettings::isValid(const QString &name, const QString &sequences) c
return findOverlaps(name, sequences).isEmpty(); return findOverlaps(name, sequences).isEmpty();
} }
/** /** @brief Checks if the shortcut is a shortcut that is active in all windows. */
* Checks if the shortcut is a shortcut that is active in all windows
*/
static bool isAlwaysActiveShortcut(const QString &shortcutName) static bool isAlwaysActiveShortcut(const QString &shortcutName)
{ {
return shortcutName.startsWith("MainWindow") || shortcutName.startsWith("Tabs"); return shortcutName.startsWith("MainWindow") || shortcutName.startsWith("Tabs");

View file

@ -12,16 +12,16 @@
*/ */
namespace CardDimensions namespace CardDimensions
{ {
/// Card width in pixels /** @brief Card width in pixels. */
constexpr int WIDTH = 72; constexpr int WIDTH = 72;
/// Card height in pixels /** @brief Card height in pixels. */
constexpr int HEIGHT = 102; constexpr int HEIGHT = 102;
/// Pre-converted for floating-point contexts (Z-value calculations) /** @brief Pre-converted for floating-point contexts (Z-value calculations). */
constexpr qreal WIDTH_F = static_cast<qreal>(WIDTH); constexpr qreal WIDTH_F = static_cast<qreal>(WIDTH);
constexpr qreal HEIGHT_F = static_cast<qreal>(HEIGHT); constexpr qreal HEIGHT_F = static_cast<qreal>(HEIGHT);
/// Half-dimensions for centering and rotation transforms /** @brief Half-dimensions for centering and rotation transforms. */
constexpr qreal WIDTH_HALF_F = WIDTH_F / 2; constexpr qreal WIDTH_HALF_F = WIDTH_F / 2;
constexpr qreal HEIGHT_HALF_F = HEIGHT_F / 2; constexpr qreal HEIGHT_HALF_F = HEIGHT_F / 2;
} // namespace CardDimensions } // namespace CardDimensions

View file

@ -56,10 +56,12 @@ private:
*/ */
void updateHover(const QPointF &scenePos); void updateHover(const QPointF &scenePos);
/// Activates hover state and escapes the card from its clip container so hover scaling is visible beyond zone /**
/// bounds. * @brief Activates hover state and escapes the card from its clip container
* so hover scaling is visible beyond zone bounds.
*/
void beginCardHover(CardItem *card); void beginCardHover(CardItem *card);
/// Deactivates hover state and restores the card to its clip container. /** @brief Deactivates hover state and restores the card to its clip container. */
void endCardHover(CardItem *card); void endCardHover(CardItem *card);
public: public:
@ -70,13 +72,13 @@ public:
*/ */
explicit GameScene(PhasesToolbar *_phasesToolbar, QObject *parent = nullptr); explicit GameScene(PhasesToolbar *_phasesToolbar, QObject *parent = nullptr);
/** Destructor, cleans up timer and zone views. */ /** @brief Destructor, cleans up timer and zone views. */
~GameScene() override; ~GameScene() override;
/** Updates UI text for all zone views. */ /** @brief Updates UI text for all zone views. */
void retranslateUi(); void retranslateUi();
/** Gets all selected CardItems */ /** @brief Gets all selected CardItems. */
QList<CardItem *> selectedCards() const; QList<CardItem *> selectedCards() const;
/** /**
@ -97,7 +99,7 @@ public:
*/ */
void adjustPlayerRotation(int rotationAdjustment); void adjustPlayerRotation(int rotationAdjustment);
/** Recomputes the layout of players and the scene size. */ /** @brief Recomputes the layout of players and the scene size. */
void rearrange(); void rearrange();
/** /**
@ -157,50 +159,50 @@ public:
*/ */
void resizeColumnsAndPlayers(const QList<qreal> &minWidthByColumn, qreal newWidth); void resizeColumnsAndPlayers(const QList<qreal> &minWidthByColumn, qreal newWidth);
/** Finds the topmost card zone under the cursor. */ /** @brief Finds the topmost card zone under the cursor. */
static CardZone *findTopmostZone(const QList<QGraphicsItem *> &items); static CardZone *findTopmostZone(const QList<QGraphicsItem *> &items);
/** Finds the topmost card in a given zone, considering attachments and Z-order. */ /** @brief Finds the topmost card in a given zone, considering attachments and Z-order. */
static CardItem *findTopmostCardInZone(const QList<QGraphicsItem *> &items, CardZone *zone); static CardItem *findTopmostCardInZone(const QList<QGraphicsItem *> &items, CardZone *zone);
/** Updates hovered card highlighting. */ /** @brief Updates hovered card highlighting. */
void updateHoveredCard(CardItem *newCard); void updateHoveredCard(CardItem *newCard);
/** Registers a card for animation updates. */ /** @brief Registers a card for animation updates. */
void registerAnimationItem(AbstractCardItem *card); void registerAnimationItem(AbstractCardItem *card);
/** Unregisters a card from animation updates. */ /** @brief Unregisters a card from animation updates. */
void unregisterAnimationItem(AbstractCardItem *card); void unregisterAnimationItem(AbstractCardItem *card);
void startRubberBand(const QPointF &selectionOrigin); void startRubberBand(const QPointF &selectionOrigin);
void resizeRubberBand(const QPointF &cursorPoint, int selectedCount); void resizeRubberBand(const QPointF &cursorPoint, int selectedCount);
void stopRubberBand(); void stopRubberBand();
public slots: public slots:
/** Toggles a zone view for a player. */ /** @brief Toggles a zone view for a player. */
void toggleZoneView(PlayerLogic *player, const QString &zoneName, int numberCards, bool isReversed = false); void toggleZoneView(PlayerLogic *player, const QString &zoneName, int numberCards, bool isReversed = false);
/** Adds a revealed zone view (for shown cards). */ /** @brief Adds a revealed zone view (for shown cards). */
void addRevealedZoneView(PlayerLogic *player, void addRevealedZoneView(PlayerLogic *player,
CardZoneLogic *zone, CardZoneLogic *zone,
const QList<const ServerInfo_Card *> &cardList, const QList<const ServerInfo_Card *> &cardList,
bool withWritePermission); bool withWritePermission);
/** Removes a zone view widget from the scene. */ /** @brief Removes a zone view widget from the scene. */
void removeZoneView(ZoneViewWidget *item); void removeZoneView(ZoneViewWidget *item);
/** Closes all zone views. */ /** @brief Closes all zone views. */
void clearViews(); void clearViews();
/** Closes the most recently added zone view. */ /** @brief Closes the most recently added zone view. */
void closeMostRecentZoneView(); void closeMostRecentZoneView();
QTransform getViewTransform() const; QTransform getViewTransform() const;
QTransform getViewportTransform() const; QTransform getViewportTransform() const;
protected: protected:
/** Handles hover updates. */ /** @brief Handles hover updates. */
bool event(QEvent *event) override; bool event(QEvent *event) override;
/** Handles animation timer updates. */ /** @brief Handles animation timer updates. */
void timerEvent(QTimerEvent *event) override; void timerEvent(QTimerEvent *event) override;
signals: signals:

View file

@ -19,13 +19,13 @@ class AbstractPlayerComponent
public: public:
virtual ~AbstractPlayerComponent() = default; virtual ~AbstractPlayerComponent() = default;
/// Bind keyboard shortcuts. Called when this player gains focus. /** @brief Bind keyboard shortcuts. Called when this player gains focus. */
virtual void setShortcutsActive() = 0; virtual void setShortcutsActive() = 0;
/// Unbind keyboard shortcuts. Called when this player loses focus. /** @brief Unbind keyboard shortcuts. Called when this player loses focus. */
virtual void setShortcutsInactive() = 0; virtual void setShortcutsInactive() = 0;
/// Retranslate all user-visible strings. Called on language change. /** @brief Retranslate all user-visible strings. Called on language change. */
virtual void retranslateUi() = 0; virtual void retranslateUi() = 0;
}; };

View file

@ -38,7 +38,7 @@ private slots:
public: public:
explicit PlayerMenu(PlayerLogic *player); explicit PlayerMenu(PlayerLogic *player);
/// Lifecycle methods: delegate to all managedComponents, plus counters separately via player->getCounters(). /** @brief Retranslate all user-visible strings. Called on language change. */
void retranslateUi(); void retranslateUi();
QMenu *updateCardMenu(const CardItem *card); QMenu *updateCardMenu(const CardItem *card);
@ -68,9 +68,9 @@ public:
return shortcutsActive; return shortcutsActive;
} }
/// Delegates to all managedComponents, plus counters separately. /** @brief Bind keyboard shortcuts. Called when this player gains focus. */
void setShortcutsActive(); void setShortcutsActive();
/// Delegates to all managedComponents, plus counters separately. /** @brief Unbind keyboard shortcuts. Called when this player loses focus. */
void setShortcutsInactive(); void setShortcutsInactive();
private: private:
@ -86,11 +86,12 @@ private:
SayMenu *sayMenu; SayMenu *sayMenu;
CustomZoneMenu *customZonesMenu; CustomZoneMenu *customZonesMenu;
/// Drives AbstractPlayerComponent lifecycle delegation. Counters are iterated separately via player->getCounters(). /** @brief Drives AbstractPlayerComponent lifecycle delegation. Counters are iterated separately via
* player->getCounters(). */
QList<AbstractPlayerComponent *> managedComponents; QList<AbstractPlayerComponent *> managedComponents;
bool shortcutsActive = false; bool shortcutsActive = false;
/// Creates component, adds it as a submenu of playerMenu, and registers in managedComponents. /** @brief Creates component, adds it as a submenu of playerMenu, and registers in managedComponents. */
template <typename MenuT, typename... Args> MenuT *addManagedMenu(Args &&...args) template <typename MenuT, typename... Args> MenuT *addManagedMenu(Args &&...args)
{ {
auto *menu = new MenuT(std::forward<Args>(args)...); auto *menu = new MenuT(std::forward<Args>(args)...);
@ -99,7 +100,7 @@ private:
return menu; return menu;
} }
/// Creates component and registers in managedComponents, but does NOT add it as a submenu. /** @brief Creates component and registers in managedComponents, but does NOT add it as a submenu. */
template <typename ComponentT, typename... Args> ComponentT *createManagedComponent(Args &&...args) template <typename ComponentT, typename... Args> ComponentT *createManagedComponent(Args &&...args)
{ {
auto *component = new ComponentT(std::forward<Args>(args)...); auto *component = new ComponentT(std::forward<Args>(args)...);

View file

@ -66,12 +66,9 @@ namespace ZValueLayerManager
*/ */
enum class Layer enum class Layer
{ {
/// Zone-level elements like backgrounds and containers Zone, ///< Zone-level elements like backgrounds and containers.
Zone, Card, ///< Cards rendered in zones (uses sequential Z-values).
/// Cards rendered in zones (uses sequential Z-values) Overlay ///< Temporary UI elements like hovered cards and drag items.
Card,
/// Temporary UI elements like hovered cards and drag items
Overlay
}; };
/** /**

View file

@ -40,9 +40,12 @@ protected:
} }
public slots: public slots:
bool showContextMenu(const QPoint &screenPos); bool showContextMenu(const QPoint &screenPos);
/// @brief Called when a card is added to this zone. Default: reparents card to this item. /**
/// Virtual so subclasses (e.g. SelectZone) can override parenting behavior — the Qt signal * @brief Called when a card is added to this zone. Default: reparents card to this item.
/// connection in CardZone's constructor dispatches through the vtable. *
* Virtual so subclasses (e.g. SelectZone) can override parenting behavior the Qt signal
* connection in CardZone's constructor dispatches through the vtable.
*/
virtual void onCardAdded(CardItem *addedCard); virtual void onCardAdded(CardItem *addedCard);
public: public:

View file

@ -21,33 +21,41 @@ class SelectZone : public CardZone
{ {
Q_OBJECT Q_OBJECT
public: public:
/// Finds the SelectZone that owns a card, regardless of whether the card is parented /**
/// to the zone directly or to its clip container. Returns nullptr if not in a SelectZone. * @brief Finds the SelectZone that owns a card, regardless of whether the card is parented
* to the zone directly or to its clip container. Returns nullptr if not in a SelectZone.
*/
static SelectZone *findOwningSelectZone(const QGraphicsItem *card); static SelectZone *findOwningSelectZone(const QGraphicsItem *card);
SelectZone(CardZoneLogic *logic, QGraphicsItem *parent = nullptr); SelectZone(CardZoneLogic *logic, QGraphicsItem *parent = nullptr);
~SelectZone() override; ~SelectZone() override;
void onCardAdded(CardItem *addedCard) override; void onCardAdded(CardItem *addedCard) override;
/// @brief Temporarily reparents a card from the clip container to this zone so hover scaling is visible beyond clip /**
/// bounds. Safe no-op if no clip container exists. Coordinates are preserved (clip container is at (0,0) with no * @brief Temporarily reparents a card from the clip container to this zone so hover scaling is visible beyond clip
/// transform). * bounds. Safe no-op if no clip container exists. Coordinates are preserved (clip container is at (0,0) with no
* transform).
*/
void escapeClipForHover(QGraphicsItem *card); void escapeClipForHover(QGraphicsItem *card);
/// @brief Restores a hover-escaped card back to the clip container. Guards against zone transitions that already /**
/// reparented the card. * @brief Restores a hover-escaped card back to the clip container. Guards against zone transitions that already
* reparented the card.
*/
void restoreClipAfterHover(QGraphicsItem *card); void restoreClipAfterHover(QGraphicsItem *card);
private: private:
QPointF selectionOrigin; QPointF selectionOrigin;
QSet<CardItem *> cardsInSelectionRect; QSet<CardItem *> cardsInSelectionRect;
/// Invisible clipping parent for cards; owned by Qt parent-child tree (parented to this zone). /**
/// Created by setupClipContainer(); null when no clip container is active. * @brief Invisible clipping parent for cards; owned by Qt parent-child tree (parented to this zone).
* Created by setupClipContainer(); null when no clip container is active.
*/
QGraphicsRectItem *cardClipContainer = nullptr; QGraphicsRectItem *cardClipContainer = nullptr;
protected: protected:
// -- Layout computation -- // -- Layout computation --
/// Parameters describing a vertical card stack's geometry. /** @brief Parameters describing a vertical card stack's geometry. */
struct StackLayoutParams struct StackLayoutParams
{ {
int cardCount; ///< Number of cards in the stack int cardCount; ///< Number of cards in the stack
@ -55,21 +63,23 @@ protected:
qreal cardHeight; ///< Height of a single card qreal cardHeight; ///< Height of a single card
qreal desiredOffset; ///< Preferred vertical offset between card tops qreal desiredOffset; ///< Preferred vertical offset between card tops
qreal minOffset = 0.0; ///< Minimum offset to preserve (0 allows full compression) qreal minOffset = 0.0; ///< Minimum offset to preserve (0 allows full compression)
/// When false (default), reserves full cardHeight for the bottom card, ensuring /**
/// all cards remain within zone bounds. When true, allows the bottom card to * @brief When false (default), reserves full cardHeight for the bottom card, ensuring
/// partially overflow using sqrt-scaled allowance. Use with setupClipContainer() * all cards remain within zone bounds. When true, allows the bottom card to
/// for zones too short to fit a full card. * partially overflow using sqrt-scaled allowance. Use with setupClipContainer()
* for zones too short to fit a full card.
*/
bool allowBottomOverflow = false; bool allowBottomOverflow = false;
}; };
/// Result of computing a vertical stack layout. /** @brief Result of computing a vertical stack layout. */
struct ZoneLayout struct ZoneLayout
{ {
qreal effectiveOffset; ///< Actual offset between card tops (may be compressed) qreal effectiveOffset; ///< Actual offset between card tops (may be compressed)
qreal start; ///< Y coordinate of the first card's top edge qreal start; ///< Y coordinate of the first card's top edge
}; };
/// Minimum visible pixels of each card's top edge when stacking compresses offsets in tight zones. /** @brief Minimum visible pixels of each card's top edge when stacking compresses offsets in tight zones. */
static constexpr qreal MIN_CARD_VISIBLE = 10.0; static constexpr qreal MIN_CARD_VISIBLE = 10.0;
/** /**
@ -88,11 +98,13 @@ protected:
*/ */
static ZoneLayout computeZoneLayout(const StackLayoutParams &params); static ZoneLayout computeZoneLayout(const StackLayoutParams &params);
/// Builds StackLayoutParams from the current card list and zone geometry. /** @brief Builds StackLayoutParams from the current card list and zone geometry. */
StackLayoutParams buildStackParams(qreal minOffset = 0.0) const; StackLayoutParams buildStackParams(qreal minOffset = 0.0) const;
/// Computes the card index at a given y-coordinate within the zone's vertical layout. /**
/// Returns 0 if the zone has no cards or the offset is zero. * @brief Computes the card index at a given y-coordinate within the zone's vertical layout.
* Returns 0 if the zone has no cards or the offset is zero.
*/
int calcDropIndexFromY(qreal dropY, qreal minOffset = 0.0) const; int calcDropIndexFromY(qreal dropY, qreal minOffset = 0.0) const;
/** /**
@ -111,17 +123,21 @@ protected:
// (e.g., zones too short to fit a full card). To enable: call setupClipContainer() in the // (e.g., zones too short to fit a full card). To enable: call setupClipContainer() in the
// zone's constructor, and set allowBottomOverflow=true in layout params. // zone's constructor, and set allowBottomOverflow=true in layout params.
/// Restores any cards that were hover-escaped but whose hover state was not properly cleaned up. /**
/// Call at the start of reorganizeCards() in zones that use a clip container. * @brief Restores any cards that were hover-escaped but whose hover state was not properly cleaned up.
* Call at the start of reorganizeCards() in zones that use a clip container.
*/
void restoreStaleEscapedCards(); void restoreStaleEscapedCards();
/// Creates a clip container child item that clips card overflow to zone bounds. /**
/// Cards entering this zone are reparented to this container by the onCardAdded override. * @brief Creates a clip container child item that clips card overflow to zone bounds.
/// Disables zone-level child clipping; clipping is delegated to the container. * Cards entering this zone are reparented to this container by the onCardAdded override.
/// @param zValue Optional z-value for the clip container (e.g. ZValues::CARD_BASE) * Disables zone-level child clipping; clipping is delegated to the container.
* @param zValue Optional z-value for the clip container (e.g. ZValues::CARD_BASE)
*/
void setupClipContainer(std::optional<qreal> zValue = std::nullopt); void setupClipContainer(std::optional<qreal> zValue = std::nullopt);
/// Updates the clip container rect to match this zone's current boundingRect(). /** @brief Updates the clip container rect to match this zone's current boundingRect(). */
void updateClipRect(); void updateClipRect();
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;

View file

@ -20,7 +20,7 @@ private slots:
public: public:
StackZone(StackZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent); StackZone(StackZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent);
/// @brief Resizes the stack zone height, e.g. when sharing vertical space with the command zone. /** @brief Resizes the stack zone height, e.g. when sharing vertical space with the command zone. */
void setHeight(qreal newHeight); void setHeight(qreal newHeight);
void void
handleDropEvent(const QList<CardDragItem *> &dragItems, CardZoneLogic *startZone, const QPoint &dropPoint) override; handleDropEvent(const QList<CardDragItem *> &dragItems, CardZoneLogic *startZone, const QPoint &dropPoint) override;

View file

@ -531,7 +531,7 @@ void DeckEditorDeckDockWidget::changeSelectedCard(int changeBy)
// currentIndex will return an index for the underlying deckModel instead of the proxy. // currentIndex will return an index for the underlying deckModel instead of the proxy.
// That index will return an invalid index when indexBelow/indexAbove crosses a header node, // That index will return an invalid index when indexBelow/indexAbove crosses a header node,
// causing the selection to fail to move down. // causing the selection to fail to move down.
/// \todo Figure out why it's happening so we can do a proper fix instead of a hacky workaround /** @todo Figure out why it's happening so we can do a proper fix instead of a hacky workaround. */
if (deckViewCurrentIndex.model() == proxy->sourceModel()) { if (deckViewCurrentIndex.model() == proxy->sourceModel()) {
deckViewCurrentIndex = proxy->mapFromSource(deckViewCurrentIndex); deckViewCurrentIndex = proxy->mapFromSource(deckViewCurrentIndex);
} }

View file

@ -154,9 +154,11 @@ public:
*/ */
QModelIndex modifyDeck(const QString &reason, const std::function<QModelIndex(DeckListModel *)> &operation); QModelIndex modifyDeck(const QString &reason, const std::function<QModelIndex(DeckListModel *)> &operation);
/// @name Metadata setters /**
/// @brief These methods set the metadata. Will no-op if the new value is the same as the current value. * @name Metadata setters
/// Saves the operation to history if successful. * @brief These methods set the metadata. Will no-op if the new value is the same as the current value.
* Saves the operation to history if successful.
*/
///@{ ///@{
void setName(const QString &name); void setName(const QString &name);
void setComments(const QString &comments); void setComments(const QString &comments);

View file

@ -99,13 +99,13 @@ protected:
void mouseMoveEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override;
private: private:
/// Map of color keys to counts used for rendering. /** @brief Map of color keys to counts used for rendering. */
QList<QPair<QString, int>> colors; QList<QPair<QString, int>> colors;
/// True if the mouse is currently inside the widget. /** @brief True if the mouse is currently inside the widget. */
bool isHovered = false; bool isHovered = false;
/// Minimum ratio a segment must exceed to be drawn. /** @brief Minimum ratio a segment must exceed to be drawn. */
double minRatioThreshold = 0.0; double minRatioThreshold = 0.0;
/** /**

View file

@ -103,8 +103,12 @@ void ReplayTimelineWidget::skipToTime(int newTime, bool doRewindBuffering)
update(); update();
} }
/// @param doRewindBuffering When true, if multiple backward skips are made in quick succession, only a single rewind /**
/// is processed at the end. When false, the backwards skip will always cause an immediate rewind * @brief Handles a backwards skip in the replay timeline.
*
* @param doRewindBuffering When true, if multiple backward skips are made in quick succession, only a single rewind
* is processed at the end. When false, the backwards skip will always cause an immediate rewind.
*/
void ReplayTimelineWidget::handleBackwardsSkip(bool doRewindBuffering) void ReplayTimelineWidget::handleBackwardsSkip(bool doRewindBuffering)
{ {
if (doRewindBuffering) { if (doRewindBuffering) {
@ -151,7 +155,7 @@ void ReplayTimelineWidget::replayTimerTimeout()
} }
} }
/// Processes all unprocessed events up to the current time. /** @brief Processes all unprocessed events up to the current time. */
void ReplayTimelineWidget::processNewEvents(PlaybackMode playbackMode) void ReplayTimelineWidget::processNewEvents(PlaybackMode playbackMode)
{ {
currentProcessedTime = currentVisualTime; currentProcessedTime = currentVisualTime;

View file

@ -82,16 +82,16 @@ public:
void resizeEvent(QResizeEvent *event) override; void resizeEvent(QResizeEvent *event) override;
private: private:
/// Slider controlling the scale of card thumbnails in all deck entry widgets. /** @brief Slider controlling the scale of card thumbnails in all deck entry widgets. */
CardSizeWidget *cardSizeSlider; CardSizeWidget *cardSizeSlider;
/// Main horizontal layout containing the FlowWidget. /** @brief Main horizontal layout containing the FlowWidget. */
QHBoxLayout *layout; QHBoxLayout *layout;
/// Container providing scrollable multi-row flow layout of deck entries. /** @brief Container providing scrollable multi-row flow layout of deck entries. */
FlowWidget *flowWidget; FlowWidget *flowWidget;
/// Shared network manager used to download card images for all child entry widgets. /** @brief Shared network manager used to download card images for all child entry widgets. */
QNetworkAccessManager *imageNetworkManager; QNetworkAccessManager *imageNetworkManager;
}; };

View file

@ -63,19 +63,19 @@ public:
CardDatabaseModel *_cardDatabaseModel, CardDatabaseModel *_cardDatabaseModel,
CardDatabaseDisplayModel *_cardDatabaseDisplayModel); CardDatabaseDisplayModel *_cardDatabaseDisplayModel);
/// Add a new tab with a widget and title. /** @brief Add a new tab with a widget and title. */
void addNewTab(QWidget *widget, const QString &title); void addNewTab(QWidget *widget, const QString &title);
/// Remove the currently active tab. /** @brief Remove the currently active tab. */
void removeCurrentTab(); void removeCurrentTab();
/// Set the title of a specific tab. /** @brief Set the title of a specific tab. */
void setTabTitle(int index, const QString &title); void setTabTitle(int index, const QString &title);
/// Get the currently active tab widget. /** @brief Get the currently active tab widget. */
[[nodiscard]] QWidget *getCurrentTab() const; [[nodiscard]] QWidget *getCurrentTab() const;
/// Get the total number of tabs. /** @brief Get the total number of tabs. */
[[nodiscard]] int getTabCount() const; [[nodiscard]] int getTabCount() const;
VisualDeckEditorWidget *visualDeckView; ///< Visual deck editor widget. VisualDeckEditorWidget *visualDeckView; ///< Visual deck editor widget.

View file

@ -104,37 +104,37 @@ private slots:
void updateDisplayType(); void updateDisplayType();
private: private:
/// Layout for grouping and sorting UI elements. /** @brief Layout for grouping and sorting UI elements. */
QHBoxLayout *groupAndSortLayout; QHBoxLayout *groupAndSortLayout;
/// Current deck display type. /** @brief Current deck display type. */
DisplayType currentDisplayType = DisplayType::Overlap; DisplayType currentDisplayType = DisplayType::Overlap;
/// Button used to toggle the display layout. /** @brief Button used to toggle the display layout. */
CompactPushButton *displayTypeButton; CompactPushButton *displayTypeButton;
/// Label for the group-by selector. /** @brief Label for the group-by selector. */
QLabel *groupByLabel; QLabel *groupByLabel;
/// Combo box listing group-by criteria. /** @brief Combo box listing group-by criteria. */
QComboBox *groupByComboBox; QComboBox *groupByComboBox;
/// Currently active group-by criterion. /** @brief Currently active group-by criterion. */
QString activeGroupCriteria = "maintype"; QString activeGroupCriteria = "maintype";
/// Encapsulates the sort settings widgets (label + list). /** @brief Encapsulates the sort settings widgets (label + list). */
SettingsButtonWidget *sortCriteriaButton; SettingsButtonWidget *sortCriteriaButton;
/// Label for “Sort by”. /** @brief Label for "Sort by". */
QLabel *sortByLabel; QLabel *sortByLabel;
/// Descriptive label inside the sort criteria button. /** @brief Descriptive label inside the sort criteria button. */
QLabel *sortLabel; QLabel *sortLabel;
/// Draggable list of sort criteria. /** @brief Draggable list of sort criteria. */
QListWidget *sortByListWidget; QListWidget *sortByListWidget;
/// Ordered list of current sort criteria. /** @brief Ordered list of current sort criteria. */
QStringList activeSortCriteria = {"name", "cmc", "colors", "maintype"}; QStringList activeSortCriteria = {"name", "cmc", "colors", "maintype"};
}; };

View file

@ -30,27 +30,27 @@ class CardDatabase : public QObject
Q_OBJECT Q_OBJECT
protected: protected:
/// Controller to determine set priority when choosing preferred printings. /** @brief Controller to determine set priority when choosing preferred printings. */
ICardSetPriorityController *setPriorityController; ICardSetPriorityController *setPriorityController;
/// Cards indexed by exact name /** @brief Cards indexed by exact name. */
CardNameMap cards; CardNameMap cards;
/// Cards indexed by simplified name (normalized) /** @brief Cards indexed by simplified name (normalized). */
CardNameMap simpleNameCards; CardNameMap simpleNameCards;
/// Sets indexed by short name /** @brief Sets indexed by short name. */
SetNameMap sets; SetNameMap sets;
FormatRulesNameMap formats; FormatRulesNameMap formats;
/// Loader responsible for file discovery and parsing /** @brief Loader responsible for file discovery and parsing. */
CardDatabaseLoader *loader; CardDatabaseLoader *loader;
/// Current load status of the database /** @brief Current load status of the database. */
LoadStatus loadStatus; LoadStatus loadStatus;
/// Querier for higher-level card lookups /** @brief Querier for higher-level card lookups. */
CardDatabaseQuerier *querier; CardDatabaseQuerier *querier;
private: private:
@ -64,7 +64,7 @@ private:
*/ */
void refreshCachedReverseRelatedCards(); void refreshCachedReverseRelatedCards();
/// Mutexes for thread safety /** @brief Mutexes for thread safety. */
QBasicMutex *clearDatabaseMutex = new QBasicMutex(), *addCardMutex = new QBasicMutex(), QBasicMutex *clearDatabaseMutex = new QBasicMutex(), *addCardMutex = new QBasicMutex(),
*removeCardMutex = new QBasicMutex(); *removeCardMutex = new QBasicMutex();

View file

@ -67,13 +67,13 @@ private:
/** @brief Private destructor. */ /** @brief Private destructor. */
~CardDatabaseManager() = default; ~CardDatabaseManager() = default;
/// Static card preference provider pointer (default: Noop) /** @brief Static card preference provider pointer (default: Noop). */
static ICardPreferenceProvider *cardPreferenceProvider; static ICardPreferenceProvider *cardPreferenceProvider;
/// Static path provider pointer (default: Noop) /** @brief Static path provider pointer (default: Noop). */
static ICardDatabasePathProvider *pathProvider; static ICardDatabasePathProvider *pathProvider;
/// Static set priority controller pointer (default: Noop) /** @brief Static set priority controller pointer (default: Noop). */
static ICardSetPriorityController *setPriorityController; static ICardSetPriorityController *setPriorityController;
}; };

View file

@ -107,31 +107,31 @@ public:
*/ */
[[nodiscard]] QString getCorrectedShortName() const; [[nodiscard]] QString getCorrectedShortName() const;
/// @return Short identifier of the set. /** @return Short identifier of the set. */
[[nodiscard]] QString getShortName() const [[nodiscard]] QString getShortName() const
{ {
return shortName; return shortName;
} }
/// @return Descriptive name of the set. /** @return Descriptive name of the set. */
[[nodiscard]] QString getLongName() const [[nodiscard]] QString getLongName() const
{ {
return longName; return longName;
} }
/// @return Type/category string of the set. /** @return Type/category string of the set. */
[[nodiscard]] QString getSetType() const [[nodiscard]] QString getSetType() const
{ {
return setType; return setType;
} }
/// @return Release date of the set. /** @return Release date of the set. */
[[nodiscard]] QDate getReleaseDate() const [[nodiscard]] QDate getReleaseDate() const
{ {
return releaseDate; return releaseDate;
} }
/// @return Priority level of the set. /** @return Priority level of the set. */
[[nodiscard]] Priority getPriority() const [[nodiscard]] Priority getPriority() const
{ {
return priority; return priority;
@ -190,7 +190,7 @@ public:
enabled = _enabled; enabled = _enabled;
} }
/// @return The sort key assigned to this set. /** @return The sort key assigned to this set. */
[[nodiscard]] int getSortKey() const [[nodiscard]] int getSortKey() const
{ {
return sortKey; return sortKey;
@ -202,7 +202,7 @@ public:
*/ */
void setSortKey(unsigned int _sortKey); void setSortKey(unsigned int _sortKey);
/// @return True if the set is enabled. /** @return True if the set is enabled. */
[[nodiscard]] bool getEnabled() const [[nodiscard]] bool getEnabled() const
{ {
return enabled; return enabled;
@ -214,7 +214,7 @@ public:
*/ */
void setEnabled(bool _enabled); void setEnabled(bool _enabled);
/// @return True if the set is considered known. /** @return True if the set is considered known. */
[[nodiscard]] bool getIsKnown() const [[nodiscard]] bool getIsKnown() const
{ {
return isknown; return isknown;

View file

@ -89,7 +89,7 @@ private:
mutable QString cachedDeckHash; mutable QString cachedDeckHash;
public: public:
/// @name Metadata setters /** @name Metadata setters */
///@{ ///@{
void setName(const QString &_name = QString()) void setName(const QString &_name = QString())
{ {
@ -125,11 +125,11 @@ public:
} }
///@} ///@}
/// @brief Construct an empty deck. /** @brief Construct an empty deck. */
explicit DeckList(); explicit DeckList();
/// @brief Construct from a serialized native-format string. /** @brief Construct from a serialized native-format string. */
explicit DeckList(const QString &nativeString); explicit DeckList(const QString &nativeString);
/// @brief Construct from components /** @brief Construct from components. */
DeckList(const Metadata &metadata, DeckList(const Metadata &metadata,
const DecklistNodeTree &tree, const DecklistNodeTree &tree,
const QMap<QString, SideboardPlan> &sideboardPlans = {}); const QMap<QString, SideboardPlan> &sideboardPlans = {});
@ -144,8 +144,10 @@ public:
return &tree; return &tree;
} }
/// @name Metadata getters /**
/// The individual metadata getters still exist for backwards compatibility. * @name Metadata getters
* The individual metadata getters still exist for backwards compatibility.
*/
///@{ ///@{
//! \todo Figure out when we can remove them. //! \todo Figure out when we can remove them.
const Metadata &getMetadata() const const Metadata &getMetadata() const
@ -183,7 +185,7 @@ public:
return metadata.isEmpty() && getCardList().isEmpty(); return metadata.isEmpty() && getCardList().isEmpty();
} }
/// @name Sideboard plans /** @name Sideboard plans */
///@{ ///@{
QList<MoveCard_ToZone> getCurrentSideboardPlan() const; QList<MoveCard_ToZone> getCurrentSideboardPlan() const;
void setCurrentSideboardPlan(const QList<MoveCard_ToZone> &plan); void setCurrentSideboardPlan(const QList<MoveCard_ToZone> &plan);
@ -193,7 +195,7 @@ public:
} }
///@} ///@}
/// @name Serialization (XML) /** @name Serialization (XML) */
///@{ ///@{
bool readElement(QXmlStreamReader *xml); bool readElement(QXmlStreamReader *xml);
void write(QXmlStreamWriter *xml) const; void write(QXmlStreamWriter *xml) const;
@ -204,7 +206,7 @@ public:
bool saveToFile_Native(QIODevice *device) const; bool saveToFile_Native(QIODevice *device) const;
///@} ///@}
/// @name Serialization (Plain text) /** @name Serialization (Plain text) */
///@{ ///@{
bool loadFromStream_Plain(QTextStream &stream, bool loadFromStream_Plain(QTextStream &stream,
bool preserveMetadata, bool preserveMetadata,
@ -216,7 +218,7 @@ public:
QString writeToString_Plain(bool prefixSideboardCards = true, bool slashTappedOutSplitCards = false) const; QString writeToString_Plain(bool prefixSideboardCards = true, bool slashTappedOutSplitCards = false) const;
///@} ///@}
/// @name Deck manipulation /** @name Deck manipulation */
///@{ ///@{
void cleanList(bool preserveMetadata = false); void cleanList(bool preserveMetadata = false);
bool isEmpty() const bool isEmpty() const
@ -238,7 +240,7 @@ public:
const bool formatLegal = true); const bool formatLegal = true);
///@} ///@}
/// @name Deck identity /** @name Deck identity */
///@{ ///@{
QString getDeckHash() const; QString getDeckHash() const;
void refreshDeckHash(); void refreshDeckHash();

View file

@ -12,11 +12,11 @@ class DecklistNodeTree
InnerDecklistNode *root; ///< Root of the deck tree (zones + cards). InnerDecklistNode *root; ///< Root of the deck tree (zones + cards).
public: public:
/// @brief Constructs an empty DecklistNodeTree /** @brief Constructs an empty DecklistNodeTree. */
explicit DecklistNodeTree(); explicit DecklistNodeTree();
/// @brief Copy constructor. Deep copies the tree /** @brief Copy constructor. Deep copies the tree. */
explicit DecklistNodeTree(const DecklistNodeTree &other); explicit DecklistNodeTree(const DecklistNodeTree &other);
/// @brief Copy-assignment operator. Deep copies the tree /** @brief Copy-assignment operator. Deep copies the tree. */
DecklistNodeTree &operator=(const DecklistNodeTree &other); DecklistNodeTree &operator=(const DecklistNodeTree &other);
virtual ~DecklistNodeTree(); virtual ~DecklistNodeTree();

View file

@ -51,19 +51,19 @@ public:
*/ */
void write(QXmlStreamWriter *xml) const; void write(QXmlStreamWriter *xml) const;
/// @return The plan name. /** @return The plan name. */
[[nodiscard]] QString getName() const [[nodiscard]] QString getName() const
{ {
return name; return name;
} }
/// @return Const reference to the move list. /** @return Const reference to the move list. */
[[nodiscard]] const QList<MoveCard_ToZone> &getMoveList() const [[nodiscard]] const QList<MoveCard_ToZone> &getMoveList() const
{ {
return moveList; return moveList;
} }
/// @brief Replace the move list with a new one. /** @brief Replace the move list with a new one. */
void setMoveList(const QList<MoveCard_ToZone> &_moveList); void setMoveList(const QList<MoveCard_ToZone> &_moveList);
}; };

View file

@ -58,40 +58,40 @@ public:
{ {
} }
/// @return The number of copies of this card in the deck. /** @return The number of copies of this card in the deck. */
[[nodiscard]] virtual int getNumber() const = 0; [[nodiscard]] virtual int getNumber() const = 0;
/// @param _number Set the number of copies of this card. /** @param _number Set the number of copies of this card. */
virtual void setNumber(int _number) = 0; virtual void setNumber(int _number) = 0;
/// @return The display name of this card. /** @return The display name of this card. */
[[nodiscard]] QString getName() const override = 0; [[nodiscard]] QString getName() const override = 0;
/// @param _name Set the display name of this card. /** @param _name Set the display name of this card. */
virtual void setName(const QString &_name) = 0; virtual void setName(const QString &_name) = 0;
/// @return The provider identifier for this card (e.g., UUID). /** @return The provider identifier for this card (e.g., UUID). */
[[nodiscard]] virtual QString getCardProviderId() const override = 0; [[nodiscard]] virtual QString getCardProviderId() const override = 0;
/// @param _cardProviderId Set the provider identifier for this card. /** @param _cardProviderId Set the provider identifier for this card. */
virtual void setCardProviderId(const QString &_cardProviderId) = 0; virtual void setCardProviderId(const QString &_cardProviderId) = 0;
/// @return The abbreviated set code (e.g., "NEO"). /** @return The abbreviated set code (e.g., "NEO"). */
[[nodiscard]] virtual QString getCardSetShortName() const override = 0; [[nodiscard]] virtual QString getCardSetShortName() const override = 0;
/// @param _cardSetShortName Set the abbreviated set code. /** @param _cardSetShortName Set the abbreviated set code. */
virtual void setCardSetShortName(const QString &_cardSetShortName) = 0; virtual void setCardSetShortName(const QString &_cardSetShortName) = 0;
/// @return The collector number of the card within its set. /** @return The collector number of the card within its set. */
[[nodiscard]] virtual QString getCardCollectorNumber() const override = 0; [[nodiscard]] virtual QString getCardCollectorNumber() const override = 0;
/// @param _cardSetNumber Set the collector number. /** @param _cardSetNumber Set the collector number. */
virtual void setCardCollectorNumber(const QString &_cardSetNumber) = 0; virtual void setCardCollectorNumber(const QString &_cardSetNumber) = 0;
/// @return The format legality of the card /** @return The format legality of the card. */
virtual bool getFormatLegality() const = 0; virtual bool getFormatLegality() const = 0;
/// @param _formatLegal If the card is considered legal /** @param _formatLegal If the card is considered legal. */
virtual void setFormatLegality(const bool _formatLegal) = 0; virtual void setFormatLegality(const bool _formatLegal) = 0;
/** /**

View file

@ -101,7 +101,7 @@ public:
*/ */
explicit AbstractDecklistNode(InnerDecklistNode *_parent = nullptr, int position = -1); explicit AbstractDecklistNode(InnerDecklistNode *_parent = nullptr, int position = -1);
/// Virtual destructor. Child classes must clean up their resources. /** @brief Virtual destructor. Child classes must clean up their resources. */
virtual ~AbstractDecklistNode() = default; virtual ~AbstractDecklistNode() = default;
/** /**
@ -136,7 +136,7 @@ public:
*/ */
[[nodiscard]] virtual bool isDeckHeader() const = 0; [[nodiscard]] virtual bool isDeckHeader() const = 0;
/// @return The parent node, or nullptr if this is the root. /** @return The parent node, or nullptr if this is the root. */
[[nodiscard]] InnerDecklistNode *getParent() const [[nodiscard]] InnerDecklistNode *getParent() const
{ {
return parent; return parent;

View file

@ -93,79 +93,79 @@ public:
*/ */
explicit DecklistCardNode(DecklistCardNode *other, InnerDecklistNode *_parent); explicit DecklistCardNode(DecklistCardNode *other, InnerDecklistNode *_parent);
/// @return The quantity of this card. /** @return The quantity of this card. */
[[nodiscard]] int getNumber() const override [[nodiscard]] int getNumber() const override
{ {
return number; return number;
} }
/// @param _number Set the quantity of this card. /** @param _number Set the quantity of this card. */
void setNumber(int _number) override void setNumber(int _number) override
{ {
number = _number; number = _number;
} }
/// @return The display name of this card. /** @return The display name of this card. */
[[nodiscard]] QString getName() const override [[nodiscard]] QString getName() const override
{ {
return name; return name;
} }
/// @param _name Set the display name of this card. /** @param _name Set the display name of this card. */
void setName(const QString &_name) override void setName(const QString &_name) override
{ {
name = _name; name = _name;
} }
/// @return The provider identifier for this card. /** @return The provider identifier for this card. */
[[nodiscard]] QString getCardProviderId() const override [[nodiscard]] QString getCardProviderId() const override
{ {
return cardProviderId; return cardProviderId;
} }
/// @param _providerId Set the provider identifier for this card. /** @param _providerId Set the provider identifier for this card. */
void setCardProviderId(const QString &_providerId) override void setCardProviderId(const QString &_providerId) override
{ {
cardProviderId = _providerId; cardProviderId = _providerId;
} }
/// @return The short set code (e.g., "NEO"). /** @return The short set code (e.g., "NEO"). */
[[nodiscard]] QString getCardSetShortName() const override [[nodiscard]] QString getCardSetShortName() const override
{ {
return cardSetShortName; return cardSetShortName;
} }
/// @param _cardSetShortName Set the short set code. /** @param _cardSetShortName Set the short set code. */
void setCardSetShortName(const QString &_cardSetShortName) override void setCardSetShortName(const QString &_cardSetShortName) override
{ {
cardSetShortName = _cardSetShortName; cardSetShortName = _cardSetShortName;
} }
/// @return The collector number of this card within its set. /** @return The collector number of this card within its set. */
[[nodiscard]] QString getCardCollectorNumber() const override [[nodiscard]] QString getCardCollectorNumber() const override
{ {
return cardSetNumber; return cardSetNumber;
} }
/// @param _cardSetNumber Set the collector number. /** @param _cardSetNumber Set the collector number. */
void setCardCollectorNumber(const QString &_cardSetNumber) override void setCardCollectorNumber(const QString &_cardSetNumber) override
{ {
cardSetNumber = _cardSetNumber; cardSetNumber = _cardSetNumber;
} }
/// @return The format legality of the card /** @return The format legality of the card. */
[[nodiscard]] bool getFormatLegality() const override [[nodiscard]] bool getFormatLegality() const override
{ {
return formatLegal; return formatLegal;
} }
/// @param _formatLegal If the card is considered legal /** @param _formatLegal If the card is considered legal. */
void setFormatLegality(const bool _formatLegal) override void setFormatLegality(const bool _formatLegal) override
{ {
formatLegal = _formatLegal; formatLegal = _formatLegal;
} }
/// @return Always false; card nodes are not deck headers. /** @return Always false; card nodes are not deck headers. */
[[nodiscard]] bool isDeckHeader() const override [[nodiscard]] bool isDeckHeader() const override
{ {
return false; return false;

View file

@ -18,11 +18,11 @@
#include "abstract_deck_list_node.h" #include "abstract_deck_list_node.h"
/// Constant for the "main" deck zone name. /** @brief Constant for the "main" deck zone name. */
#define DECK_ZONE_MAIN "main" #define DECK_ZONE_MAIN "main"
/// Constant for the "sideboard" zone name. /** @brief Constant for the "sideboard" zone name. */
#define DECK_ZONE_SIDE "side" #define DECK_ZONE_SIDE "side"
/// Constant for the "tokens" zone name. /** @brief Constant for the "tokens" zone name. */
#define DECK_ZONE_TOKENS "tokens" #define DECK_ZONE_TOKENS "tokens"
/** /**
@ -93,13 +93,13 @@ public:
*/ */
void setSortMethod(DeckSortMethod method) override; void setSortMethod(DeckSortMethod method) override;
/// @return The internal name of this node. /** @return The internal name of this node. */
[[nodiscard]] QString getName() const override [[nodiscard]] QString getName() const override
{ {
return name; return name;
} }
/// @param _name Set the internal name of this node. /** @param _name Set the internal name of this node. */
void setName(const QString &_name) void setName(const QString &_name)
{ {
name = _name; name = _name;
@ -122,25 +122,25 @@ public:
*/ */
[[nodiscard]] virtual QString getVisibleName() const; [[nodiscard]] virtual QString getVisibleName() const;
/// @return Always empty for container nodes. /** @return Always empty for container nodes. */
[[nodiscard]] QString getCardProviderId() const override [[nodiscard]] QString getCardProviderId() const override
{ {
return ""; return "";
} }
/// @return Always empty for container nodes. /** @return Always empty for container nodes. */
[[nodiscard]] QString getCardSetShortName() const override [[nodiscard]] QString getCardSetShortName() const override
{ {
return ""; return "";
} }
/// @return Always empty for container nodes. /** @return Always empty for container nodes. */
[[nodiscard]] QString getCardCollectorNumber() const override [[nodiscard]] QString getCardCollectorNumber() const override
{ {
return ""; return "";
} }
/// @return Always true; InnerDecklistNode represents deck structure. /** @return Always true; InnerDecklistNode represents deck structure. */
[[nodiscard]] bool isDeckHeader() const override [[nodiscard]] bool isDeckHeader() const override
{ {
return true; return true;
@ -196,10 +196,10 @@ public:
*/ */
bool compare(AbstractDecklistNode *other) const override; bool compare(AbstractDecklistNode *other) const override;
/// @copydoc compare(AbstractDecklistNode*) const /** @copydoc compare(AbstractDecklistNode*) const */
bool compareNumber(AbstractDecklistNode *other) const; bool compareNumber(AbstractDecklistNode *other) const;
/// @copydoc compare(AbstractDecklistNode*) const /** @copydoc compare(AbstractDecklistNode*) const */
bool compareName(AbstractDecklistNode *other) const; bool compareName(AbstractDecklistNode *other) const;
/** /**