mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Mark more functions as [[nodiscard]] (#6320)
* Fix local variable double declaration. Took 44 seconds * Mark functions as [[nodiscard]] Took 31 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
27708d5964
commit
73763b5ee6
65 changed files with 258 additions and 257 deletions
|
|
@ -25,7 +25,7 @@ public:
|
|||
explicit DeckPreviewTagDialog(const QStringList &knownTags,
|
||||
const QStringList &activeTags,
|
||||
QWidget *parent = nullptr);
|
||||
QStringList getActiveTags() const;
|
||||
[[nodiscard]] QStringList getActiveTags() const;
|
||||
void filterTags(const QString &text);
|
||||
|
||||
private slots:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public:
|
|||
DeckPreviewTagItemWidget(const QString &tagName, bool isChecked, QWidget *parent = nullptr);
|
||||
|
||||
// Accessor for the checkbox widget
|
||||
QCheckBox *checkBox() const;
|
||||
[[nodiscard]] QCheckBox *checkBox() const;
|
||||
|
||||
private:
|
||||
QCheckBox *checkBox_; // Checkbox to represent the tag's state
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public:
|
|||
const QString &_filePath);
|
||||
void retranslateUi();
|
||||
QString getColorIdentity();
|
||||
QString getDisplayName() const;
|
||||
[[nodiscard]] QString getDisplayName() const;
|
||||
|
||||
VisualDeckStorageWidget *visualDeckStorageWidget;
|
||||
QVBoxLayout *layout;
|
||||
|
|
@ -47,7 +47,7 @@ public:
|
|||
bool filteredBySearch = false;
|
||||
bool filteredByColor = false;
|
||||
bool filteredByTags = false;
|
||||
bool checkVisibility() const;
|
||||
[[nodiscard]] bool checkVisibility() const;
|
||||
|
||||
signals:
|
||||
void deckLoadRequested(const QString &filePath);
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ public:
|
|||
void createWidgetsForFiles();
|
||||
void createWidgetsForFolders();
|
||||
void flattenFolderStructure();
|
||||
QStringList gatherAllTagsFromFlowWidget() const;
|
||||
FlowWidget *getFlowWidget() const
|
||||
[[nodiscard]] QStringList gatherAllTagsFromFlowWidget() const;
|
||||
[[nodiscard]] FlowWidget *getFlowWidget() const
|
||||
{
|
||||
return flowWidget;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,14 +47,14 @@ public:
|
|||
|
||||
void retranslateUi();
|
||||
|
||||
bool getShowFolders() const;
|
||||
bool getDrawUnusedColorIdentities() const;
|
||||
bool getShowBannerCardComboBox() const;
|
||||
bool getShowTagFilter() const;
|
||||
bool getShowTagsOnDeckPreviews() const;
|
||||
int getUnusedColorIdentitiesOpacity() const;
|
||||
TooltipType getDeckPreviewTooltip() const;
|
||||
int getCardSize() const;
|
||||
[[nodiscard]] bool getShowFolders() const;
|
||||
[[nodiscard]] bool getDrawUnusedColorIdentities() const;
|
||||
[[nodiscard]] bool getShowBannerCardComboBox() const;
|
||||
[[nodiscard]] bool getShowTagFilter() const;
|
||||
[[nodiscard]] bool getShowTagsOnDeckPreviews() const;
|
||||
[[nodiscard]] int getUnusedColorIdentitiesOpacity() const;
|
||||
[[nodiscard]] TooltipType getDeckPreviewTooltip() const;
|
||||
[[nodiscard]] int getCardSize() const;
|
||||
|
||||
signals:
|
||||
void showFoldersChanged(bool enabled);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class VisualDeckStorageTagFilterWidget : public QWidget
|
|||
|
||||
VisualDeckStorageWidget *parent;
|
||||
|
||||
QSet<QString> gatherAllTags() const;
|
||||
[[nodiscard]] QSet<QString> gatherAllTags() const;
|
||||
void removeTagsNotInList(const QSet<QString> &tags);
|
||||
void addTagsIfNotPresent(const QSet<QString> &tags);
|
||||
void addTagIfNotPresent(const QString &tag);
|
||||
|
|
@ -26,7 +26,7 @@ class VisualDeckStorageTagFilterWidget : public QWidget
|
|||
|
||||
public:
|
||||
explicit VisualDeckStorageTagFilterWidget(VisualDeckStorageWidget *_parent);
|
||||
QStringList getAllKnownTags() const;
|
||||
[[nodiscard]] QStringList getAllKnownTags() const;
|
||||
void filterDecksBySelectedTags(const QList<DeckPreviewWidget *> &deckPreviews) const;
|
||||
|
||||
public slots:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public:
|
|||
VisualDeckStorageTagFilterWidget *tagFilterWidget;
|
||||
bool deckPreviewSelectionAnimationEnabled;
|
||||
|
||||
const VisualDeckStorageQuickSettingsWidget *settings() const;
|
||||
[[nodiscard]] const VisualDeckStorageQuickSettingsWidget *settings() const;
|
||||
|
||||
public slots:
|
||||
void createRootFolderWidget(); // Refresh the display of cards based on the current sorting option
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue