[Fix-Warnings] Mark const getters as [[nodiscard]] (#6365)

Took 45 minutes

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-11-28 21:38:54 +01:00 committed by GitHub
parent a1a3b02d3a
commit 9ece4bfd9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 548 additions and 543 deletions

View file

@ -91,7 +91,7 @@ public:
explicit DecklistCardNode(DecklistCardNode *other, InnerDecklistNode *_parent);
/// @return The quantity of this card.
int getNumber() const override
[[nodiscard]] int getNumber() const override
{
return number;
}
@ -103,7 +103,7 @@ public:
}
/// @return The display name of this card.
QString getName() const override
[[nodiscard]] QString getName() const override
{
return name;
}
@ -115,7 +115,7 @@ public:
}
/// @return The provider identifier for this card.
QString getCardProviderId() const override
[[nodiscard]] QString getCardProviderId() const override
{
return cardProviderId;
}
@ -127,7 +127,7 @@ public:
}
/// @return The short set code (e.g., "NEO").
QString getCardSetShortName() const override
[[nodiscard]] QString getCardSetShortName() const override
{
return cardSetShortName;
}
@ -139,7 +139,7 @@ public:
}
/// @return The collector number of this card within its set.
QString getCardCollectorNumber() const override
[[nodiscard]] QString getCardCollectorNumber() const override
{
return cardSetNumber;
}
@ -162,7 +162,7 @@ public:
* @return A CardRef with the cards name and provider ID, suitable
* for database lookups or comparison with other card sources.
*/
CardRef toCardRef() const
[[nodiscard]] CardRef toCardRef() const
{
return {name, cardProviderId};
}

View file

@ -23,12 +23,12 @@ public:
void clear();
bool canUndo() const
[[nodiscard]] bool canUndo() const
{
return !undoStack.isEmpty();
}
bool canRedo() const
[[nodiscard]] bool canRedo() const
{
return !redoStack.isEmpty();
}
@ -37,11 +37,11 @@ public:
void redo(DeckList *deck);
QStack<DeckListMemento> getRedoStack() const
[[nodiscard]] QStack<DeckListMemento> getRedoStack() const
{
return redoStack;
}
QStack<DeckListMemento> getUndoStack() const
[[nodiscard]] QStack<DeckListMemento> getUndoStack() const
{
return undoStack;
}

View file

@ -11,11 +11,11 @@ public:
{
}
QString getMemento() const
[[nodiscard]] QString getMemento() const
{
return memento;
}
QString getReason() const
[[nodiscard]] QString getReason() const
{
return reason;
}