[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
58 changed files with 548 additions and 543 deletions

View File

@@ -325,8 +325,8 @@ private:
int keepalive; int keepalive;
int timeout; int timeout;
void translateLegacySettings(); void translateLegacySettings();
QString getSafeConfigPath(QString configEntry, QString defaultPath) const; [[nodiscard]] QString getSafeConfigPath(QString configEntry, QString defaultPath) const;
QString getSafeConfigFilePath(QString configEntry, QString defaultPath) const; [[nodiscard]] QString getSafeConfigFilePath(QString configEntry, QString defaultPath) const;
void loadPaths(); void loadPaths();
bool rememberGameSettings; bool rememberGameSettings;
QList<ReleaseChannel *> releaseChannels; QList<ReleaseChannel *> releaseChannels;
@@ -338,137 +338,137 @@ public:
SettingsCache(); SettingsCache();
QString getDataPath(); QString getDataPath();
QString getSettingsPath(); QString getSettingsPath();
QString getCachePath() const; [[nodiscard]] QString getCachePath() const;
QString getNetworkCachePath() const; [[nodiscard]] QString getNetworkCachePath() const;
const QByteArray &getMainWindowGeometry() const [[nodiscard]] const QByteArray &getMainWindowGeometry() const
{ {
return mainWindowGeometry; return mainWindowGeometry;
} }
const QByteArray &getTokenDialogGeometry() const [[nodiscard]] const QByteArray &getTokenDialogGeometry() const
{ {
return tokenDialogGeometry; return tokenDialogGeometry;
} }
const QByteArray &getSetsDialogGeometry() const [[nodiscard]] const QByteArray &getSetsDialogGeometry() const
{ {
return setsDialogGeometry; return setsDialogGeometry;
} }
QString getLang() const [[nodiscard]] QString getLang() const
{ {
return lang; return lang;
} }
QString getDeckPath() const [[nodiscard]] QString getDeckPath() const
{ {
return deckPath; return deckPath;
} }
QString getFiltersPath() const [[nodiscard]] QString getFiltersPath() const
{ {
return filtersPath; return filtersPath;
} }
QString getReplaysPath() const [[nodiscard]] QString getReplaysPath() const
{ {
return replaysPath; return replaysPath;
} }
QString getThemesPath() const [[nodiscard]] QString getThemesPath() const
{ {
return themesPath; return themesPath;
} }
QString getPicsPath() const [[nodiscard]] QString getPicsPath() const
{ {
return picsPath; return picsPath;
} }
QString getRedirectCachePath() const [[nodiscard]] QString getRedirectCachePath() const
{ {
return redirectCachePath; return redirectCachePath;
} }
QString getCustomPicsPath() const [[nodiscard]] QString getCustomPicsPath() const
{ {
return customPicsPath; return customPicsPath;
} }
QString getCustomCardDatabasePath() const override [[nodiscard]] QString getCustomCardDatabasePath() const override
{ {
return customCardDatabasePath; return customCardDatabasePath;
} }
QString getCardDatabasePath() const override [[nodiscard]] QString getCardDatabasePath() const override
{ {
return cardDatabasePath; return cardDatabasePath;
} }
QString getSpoilerCardDatabasePath() const override [[nodiscard]] QString getSpoilerCardDatabasePath() const override
{ {
return spoilerDatabasePath; return spoilerDatabasePath;
} }
QString getTokenDatabasePath() const override [[nodiscard]] QString getTokenDatabasePath() const override
{ {
return tokenDatabasePath; return tokenDatabasePath;
} }
QString getThemeName() const [[nodiscard]] QString getThemeName() const
{ {
return themeName; return themeName;
} }
QString getHomeTabBackgroundSource() const [[nodiscard]] QString getHomeTabBackgroundSource() const
{ {
return homeTabBackgroundSource; return homeTabBackgroundSource;
} }
int getHomeTabBackgroundShuffleFrequency() const [[nodiscard]] int getHomeTabBackgroundShuffleFrequency() const
{ {
return homeTabBackgroundShuffleFrequency; return homeTabBackgroundShuffleFrequency;
} }
bool getTabVisualDeckStorageOpen() const [[nodiscard]] bool getTabVisualDeckStorageOpen() const
{ {
return tabVisualDeckStorageOpen; return tabVisualDeckStorageOpen;
} }
bool getTabServerOpen() const [[nodiscard]] bool getTabServerOpen() const
{ {
return tabServerOpen; return tabServerOpen;
} }
bool getTabAccountOpen() const [[nodiscard]] bool getTabAccountOpen() const
{ {
return tabAccountOpen; return tabAccountOpen;
} }
bool getTabDeckStorageOpen() const [[nodiscard]] bool getTabDeckStorageOpen() const
{ {
return tabDeckStorageOpen; return tabDeckStorageOpen;
} }
bool getTabReplaysOpen() const [[nodiscard]] bool getTabReplaysOpen() const
{ {
return tabReplaysOpen; return tabReplaysOpen;
} }
bool getTabAdminOpen() const [[nodiscard]] bool getTabAdminOpen() const
{ {
return tabAdminOpen; return tabAdminOpen;
} }
bool getTabLogOpen() const [[nodiscard]] bool getTabLogOpen() const
{ {
return tabLogOpen; return tabLogOpen;
} }
QString getChatMentionColor() const [[nodiscard]] QString getChatMentionColor() const
{ {
return chatMentionColor; return chatMentionColor;
} }
QString getChatHighlightColor() const [[nodiscard]] QString getChatHighlightColor() const
{ {
return chatHighlightColor; return chatHighlightColor;
} }
bool getPicDownload() const [[nodiscard]] bool getPicDownload() const
{ {
return picDownload; return picDownload;
} }
bool getShowStatusBar() const [[nodiscard]] bool getShowStatusBar() const
{ {
return showStatusBar; return showStatusBar;
} }
bool getNotificationsEnabled() const [[nodiscard]] bool getNotificationsEnabled() const
{ {
return notificationsEnabled; return notificationsEnabled;
} }
bool getSpectatorNotificationsEnabled() const [[nodiscard]] bool getSpectatorNotificationsEnabled() const
{ {
return spectatorNotificationsEnabled; return spectatorNotificationsEnabled;
} }
bool getBuddyConnectNotificationsEnabled() const [[nodiscard]] bool getBuddyConnectNotificationsEnabled() const
{ {
return buddyConnectNotificationsEnabled; return buddyConnectNotificationsEnabled;
} }
bool getCheckUpdatesOnStartup() const [[nodiscard]] bool getCheckUpdatesOnStartup() const
{ {
return checkUpdatesOnStartup; return checkUpdatesOnStartup;
} }
@@ -480,263 +480,263 @@ public:
{ {
return startupCardUpdateCheckAlwaysUpdate; return startupCardUpdateCheckAlwaysUpdate;
} }
int getCardUpdateCheckInterval() const [[nodiscard]] int getCardUpdateCheckInterval() const
{ {
return cardUpdateCheckInterval; return cardUpdateCheckInterval;
} }
QDate getLastCardUpdateCheck() const [[nodiscard]] QDate getLastCardUpdateCheck() const
{ {
return lastCardUpdateCheck; return lastCardUpdateCheck;
} }
bool getCardUpdateCheckRequired() const [[nodiscard]] bool getCardUpdateCheckRequired() const
{ {
return getLastCardUpdateCheck().daysTo(QDateTime::currentDateTime().date()) >= getCardUpdateCheckInterval() && return getLastCardUpdateCheck().daysTo(QDateTime::currentDateTime().date()) >= getCardUpdateCheckInterval() &&
getLastCardUpdateCheck() != QDateTime::currentDateTime().date(); getLastCardUpdateCheck() != QDateTime::currentDateTime().date();
} }
bool getNotifyAboutUpdates() const override [[nodiscard]] bool getNotifyAboutUpdates() const override
{ {
return notifyAboutUpdates; return notifyAboutUpdates;
} }
bool getNotifyAboutNewVersion() const [[nodiscard]] bool getNotifyAboutNewVersion() const
{ {
return notifyAboutNewVersion; return notifyAboutNewVersion;
} }
bool getShowTipsOnStartup() const [[nodiscard]] bool getShowTipsOnStartup() const
{ {
return showTipsOnStartup; return showTipsOnStartup;
} }
QList<int> getSeenTips() const [[nodiscard]] QList<int> getSeenTips() const
{ {
return seenTips; return seenTips;
} }
int getUpdateReleaseChannelIndex() const [[nodiscard]] int getUpdateReleaseChannelIndex() const
{ {
return updateReleaseChannel; return updateReleaseChannel;
} }
ReleaseChannel *getUpdateReleaseChannel() const [[nodiscard]] ReleaseChannel *getUpdateReleaseChannel() const
{ {
return releaseChannels.at(qMax(0, updateReleaseChannel)); return releaseChannels.at(qMax(0, updateReleaseChannel));
} }
QList<ReleaseChannel *> getUpdateReleaseChannels() const [[nodiscard]] QList<ReleaseChannel *> getUpdateReleaseChannels() const
{ {
return releaseChannels; return releaseChannels;
} }
bool getDoubleClickToPlay() const [[nodiscard]] bool getDoubleClickToPlay() const
{ {
return doubleClickToPlay; return doubleClickToPlay;
} }
bool getClickPlaysAllSelected() const [[nodiscard]] bool getClickPlaysAllSelected() const
{ {
return clickPlaysAllSelected; return clickPlaysAllSelected;
} }
bool getPlayToStack() const [[nodiscard]] bool getPlayToStack() const
{ {
return playToStack; return playToStack;
} }
bool getDoNotDeleteArrowsInSubPhases() const [[nodiscard]] bool getDoNotDeleteArrowsInSubPhases() const
{ {
return doNotDeleteArrowsInSubPhases; return doNotDeleteArrowsInSubPhases;
} }
int getStartingHandSize() const [[nodiscard]] int getStartingHandSize() const
{ {
return startingHandSize; return startingHandSize;
} }
bool getAnnotateTokens() const [[nodiscard]] bool getAnnotateTokens() const
{ {
return annotateTokens; return annotateTokens;
} }
QByteArray getTabGameSplitterSizes() const [[nodiscard]] QByteArray getTabGameSplitterSizes() const
{ {
return tabGameSplitterSizes; return tabGameSplitterSizes;
} }
bool getShowShortcuts() const [[nodiscard]] bool getShowShortcuts() const
{ {
return showShortcuts; return showShortcuts;
} }
bool getDisplayCardNames() const [[nodiscard]] bool getDisplayCardNames() const
{ {
return displayCardNames; return displayCardNames;
} }
bool getOverrideAllCardArtWithPersonalPreference() const [[nodiscard]] bool getOverrideAllCardArtWithPersonalPreference() const
{ {
return overrideAllCardArtWithPersonalPreference; return overrideAllCardArtWithPersonalPreference;
} }
bool getBumpSetsWithCardsInDeckToTop() const [[nodiscard]] bool getBumpSetsWithCardsInDeckToTop() const
{ {
return bumpSetsWithCardsInDeckToTop; return bumpSetsWithCardsInDeckToTop;
} }
int getPrintingSelectorSortOrder() const [[nodiscard]] int getPrintingSelectorSortOrder() const
{ {
return printingSelectorSortOrder; return printingSelectorSortOrder;
} }
int getPrintingSelectorCardSize() const [[nodiscard]] int getPrintingSelectorCardSize() const
{ {
return printingSelectorCardSize; return printingSelectorCardSize;
} }
bool getIncludeRebalancedCards() const [[nodiscard]] bool getIncludeRebalancedCards() const
{ {
return includeRebalancedCards; return includeRebalancedCards;
} }
bool getPrintingSelectorNavigationButtonsVisible() const [[nodiscard]] bool getPrintingSelectorNavigationButtonsVisible() const
{ {
return printingSelectorNavigationButtonsVisible; return printingSelectorNavigationButtonsVisible;
} }
bool getDeckEditorBannerCardComboBoxVisible() const [[nodiscard]] bool getDeckEditorBannerCardComboBoxVisible() const
{ {
return deckEditorBannerCardComboBoxVisible; return deckEditorBannerCardComboBoxVisible;
} }
bool getDeckEditorTagsWidgetVisible() const [[nodiscard]] bool getDeckEditorTagsWidgetVisible() const
{ {
return deckEditorTagsWidgetVisible; return deckEditorTagsWidgetVisible;
} }
int getVisualDeckStorageSortingOrder() const [[nodiscard]] int getVisualDeckStorageSortingOrder() const
{ {
return visualDeckStorageSortingOrder; return visualDeckStorageSortingOrder;
} }
bool getVisualDeckStorageShowFolders() const [[nodiscard]] bool getVisualDeckStorageShowFolders() const
{ {
return visualDeckStorageShowFolders; return visualDeckStorageShowFolders;
} }
bool getVisualDeckStorageShowTagFilter() const [[nodiscard]] bool getVisualDeckStorageShowTagFilter() const
{ {
return visualDeckStorageShowTagFilter; return visualDeckStorageShowTagFilter;
} }
QStringList getVisualDeckStorageDefaultTagsList() const [[nodiscard]] QStringList getVisualDeckStorageDefaultTagsList() const
{ {
return visualDeckStorageDefaultTagsList; return visualDeckStorageDefaultTagsList;
} }
bool getVisualDeckStorageSearchFolderNames() const [[nodiscard]] bool getVisualDeckStorageSearchFolderNames() const
{ {
return visualDeckStorageSearchFolderNames; return visualDeckStorageSearchFolderNames;
} }
bool getVisualDeckStorageShowBannerCardComboBox() const [[nodiscard]] bool getVisualDeckStorageShowBannerCardComboBox() const
{ {
return visualDeckStorageShowBannerCardComboBox; return visualDeckStorageShowBannerCardComboBox;
} }
bool getVisualDeckStorageShowTagsOnDeckPreviews() const [[nodiscard]] bool getVisualDeckStorageShowTagsOnDeckPreviews() const
{ {
return visualDeckStorageShowTagsOnDeckPreviews; return visualDeckStorageShowTagsOnDeckPreviews;
} }
int getVisualDeckStorageCardSize() const [[nodiscard]] int getVisualDeckStorageCardSize() const
{ {
return visualDeckStorageCardSize; return visualDeckStorageCardSize;
} }
bool getVisualDeckStorageDrawUnusedColorIdentities() const [[nodiscard]] bool getVisualDeckStorageDrawUnusedColorIdentities() const
{ {
return visualDeckStorageDrawUnusedColorIdentities; return visualDeckStorageDrawUnusedColorIdentities;
} }
int getVisualDeckStorageUnusedColorIdentitiesOpacity() const [[nodiscard]] int getVisualDeckStorageUnusedColorIdentitiesOpacity() const
{ {
return visualDeckStorageUnusedColorIdentitiesOpacity; return visualDeckStorageUnusedColorIdentitiesOpacity;
} }
int getVisualDeckStorageTooltipType() const [[nodiscard]] int getVisualDeckStorageTooltipType() const
{ {
return visualDeckStorageTooltipType; return visualDeckStorageTooltipType;
} }
bool getVisualDeckStoragePromptForConversion() const [[nodiscard]] bool getVisualDeckStoragePromptForConversion() const
{ {
return visualDeckStoragePromptForConversion; return visualDeckStoragePromptForConversion;
} }
bool getVisualDeckStorageAlwaysConvert() const [[nodiscard]] bool getVisualDeckStorageAlwaysConvert() const
{ {
return visualDeckStorageAlwaysConvert; return visualDeckStorageAlwaysConvert;
} }
bool getVisualDeckStorageInGame() const [[nodiscard]] bool getVisualDeckStorageInGame() const
{ {
return visualDeckStorageInGame; return visualDeckStorageInGame;
} }
bool getVisualDeckStorageSelectionAnimation() const [[nodiscard]] bool getVisualDeckStorageSelectionAnimation() const
{ {
return visualDeckStorageSelectionAnimation; return visualDeckStorageSelectionAnimation;
} }
int getVisualDeckEditorCardSize() const [[nodiscard]] int getVisualDeckEditorCardSize() const
{ {
return visualDeckEditorCardSize; return visualDeckEditorCardSize;
} }
int getVisualDatabaseDisplayCardSize() const [[nodiscard]] int getVisualDatabaseDisplayCardSize() const
{ {
return visualDatabaseDisplayCardSize; return visualDatabaseDisplayCardSize;
} }
int getEDHRecCardSize() const [[nodiscard]] int getEDHRecCardSize() const
{ {
return edhrecCardSize; return edhrecCardSize;
} }
int getArchidektPreviewSize() const [[nodiscard]] int getArchidektPreviewSize() const
{ {
return archidektPreviewSize; return archidektPreviewSize;
} }
int getDefaultDeckEditorType() const [[nodiscard]] int getDefaultDeckEditorType() const
{ {
return defaultDeckEditorType; return defaultDeckEditorType;
} }
bool getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const [[nodiscard]] bool getVisualDatabaseDisplayFilterToMostRecentSetsEnabled() const
{ {
return visualDatabaseDisplayFilterToMostRecentSetsEnabled; return visualDatabaseDisplayFilterToMostRecentSetsEnabled;
} }
int getVisualDatabaseDisplayFilterToMostRecentSetsAmount() const [[nodiscard]] int getVisualDatabaseDisplayFilterToMostRecentSetsAmount() const
{ {
return visualDatabaseDisplayFilterToMostRecentSetsAmount; return visualDatabaseDisplayFilterToMostRecentSetsAmount;
} }
int getVisualDeckEditorSampleHandSize() const [[nodiscard]] int getVisualDeckEditorSampleHandSize() const
{ {
return visualDeckEditorSampleHandSize; return visualDeckEditorSampleHandSize;
} }
bool getHorizontalHand() const [[nodiscard]] bool getHorizontalHand() const
{ {
return horizontalHand; return horizontalHand;
} }
bool getInvertVerticalCoordinate() const [[nodiscard]] bool getInvertVerticalCoordinate() const
{ {
return invertVerticalCoordinate; return invertVerticalCoordinate;
} }
int getMinPlayersForMultiColumnLayout() const [[nodiscard]] int getMinPlayersForMultiColumnLayout() const
{ {
return minPlayersForMultiColumnLayout; return minPlayersForMultiColumnLayout;
} }
bool getTapAnimation() const [[nodiscard]] bool getTapAnimation() const
{ {
return tapAnimation; return tapAnimation;
} }
bool getAutoRotateSidewaysLayoutCards() const [[nodiscard]] bool getAutoRotateSidewaysLayoutCards() const
{ {
return autoRotateSidewaysLayoutCards; return autoRotateSidewaysLayoutCards;
} }
bool getOpenDeckInNewTab() const [[nodiscard]] bool getOpenDeckInNewTab() const
{ {
return openDeckInNewTab; return openDeckInNewTab;
} }
int getRewindBufferingMs() const [[nodiscard]] int getRewindBufferingMs() const
{ {
return rewindBufferingMs; return rewindBufferingMs;
} }
bool getChatMention() const [[nodiscard]] bool getChatMention() const
{ {
return chatMention; return chatMention;
} }
bool getChatMentionCompleter() const [[nodiscard]] bool getChatMentionCompleter() const
{ {
return chatMentionCompleter; return chatMentionCompleter;
} }
bool getChatMentionForeground() const [[nodiscard]] bool getChatMentionForeground() const
{ {
return chatMentionForeground; return chatMentionForeground;
} }
bool getChatHighlightForeground() const [[nodiscard]] bool getChatHighlightForeground() const
{ {
return chatHighlightForeground; return chatHighlightForeground;
} }
/** /**
* Currently selected index for the `Group by X` QComboBox * Currently selected index for the `Group by X` QComboBox
*/ */
int getZoneViewGroupByIndex() const [[nodiscard]] int getZoneViewGroupByIndex() const
{ {
return zoneViewGroupByIndex; return zoneViewGroupByIndex;
} }
/** /**
* Currently selected index for the `Sort by X` QComboBox * Currently selected index for the `Sort by X` QComboBox
*/ */
int getZoneViewSortByIndex() const [[nodiscard]] int getZoneViewSortByIndex() const
{ {
return zoneViewSortByIndex; return zoneViewSortByIndex;
} }
@@ -744,136 +744,136 @@ public:
Returns if the view should be sorted into pile view. Returns if the view should be sorted into pile view.
@return zoneViewPileView if the view should be sorted into pile view. @return zoneViewPileView if the view should be sorted into pile view.
*/ */
bool getZoneViewPileView() const [[nodiscard]] bool getZoneViewPileView() const
{ {
return zoneViewPileView; return zoneViewPileView;
} }
bool getSoundEnabled() const [[nodiscard]] bool getSoundEnabled() const
{ {
return soundEnabled; return soundEnabled;
} }
QString getSoundThemeName() const [[nodiscard]] QString getSoundThemeName() const
{ {
return soundThemeName; return soundThemeName;
} }
bool getIgnoreUnregisteredUsers() const [[nodiscard]] bool getIgnoreUnregisteredUsers() const
{ {
return ignoreUnregisteredUsers; return ignoreUnregisteredUsers;
} }
bool getIgnoreUnregisteredUserMessages() const [[nodiscard]] bool getIgnoreUnregisteredUserMessages() const
{ {
return ignoreUnregisteredUserMessages; return ignoreUnregisteredUserMessages;
} }
int getPixmapCacheSize() const [[nodiscard]] int getPixmapCacheSize() const
{ {
return pixmapCacheSize; return pixmapCacheSize;
} }
int getNetworkCacheSizeInMB() const [[nodiscard]] int getNetworkCacheSizeInMB() const
{ {
return networkCacheSize; return networkCacheSize;
} }
int getRedirectCacheTtl() const [[nodiscard]] int getRedirectCacheTtl() const
{ {
return redirectCacheTtl; return redirectCacheTtl;
} }
bool getScaleCards() const [[nodiscard]] bool getScaleCards() const
{ {
return scaleCards; return scaleCards;
} }
int getStackCardOverlapPercent() const [[nodiscard]] int getStackCardOverlapPercent() const
{ {
return verticalCardOverlapPercent; return verticalCardOverlapPercent;
} }
bool getShowMessagePopup() const [[nodiscard]] bool getShowMessagePopup() const
{ {
return showMessagePopups; return showMessagePopups;
} }
bool getShowMentionPopup() const [[nodiscard]] bool getShowMentionPopup() const
{ {
return showMentionPopups; return showMentionPopups;
} }
bool getRoomHistory() const [[nodiscard]] bool getRoomHistory() const
{ {
return roomHistory; return roomHistory;
} }
bool getLeftJustified() const [[nodiscard]] bool getLeftJustified() const
{ {
return leftJustified; return leftJustified;
} }
int getMasterVolume() const [[nodiscard]] int getMasterVolume() const
{ {
return masterVolume; return masterVolume;
} }
int getCardInfoViewMode() const [[nodiscard]] int getCardInfoViewMode() const
{ {
return cardInfoViewMode; return cardInfoViewMode;
} }
QStringList getCountries() const; [[nodiscard]] QStringList getCountries() const;
QString getHighlightWords() const [[nodiscard]] QString getHighlightWords() const
{ {
return highlightWords; return highlightWords;
} }
QString getGameDescription() const [[nodiscard]] QString getGameDescription() const
{ {
return gameDescription; return gameDescription;
} }
int getMaxPlayers() const [[nodiscard]] int getMaxPlayers() const
{ {
return maxPlayers; return maxPlayers;
} }
QString getGameTypes() const [[nodiscard]] QString getGameTypes() const
{ {
return gameTypes; return gameTypes;
} }
bool getOnlyBuddies() const [[nodiscard]] bool getOnlyBuddies() const
{ {
return onlyBuddies; return onlyBuddies;
} }
bool getOnlyRegistered() const [[nodiscard]] bool getOnlyRegistered() const
{ {
return onlyRegistered; return onlyRegistered;
} }
bool getSpectatorsAllowed() const [[nodiscard]] bool getSpectatorsAllowed() const
{ {
return spectatorsAllowed; return spectatorsAllowed;
} }
bool getSpectatorsNeedPassword() const [[nodiscard]] bool getSpectatorsNeedPassword() const
{ {
return spectatorsNeedPassword; return spectatorsNeedPassword;
} }
bool getSpectatorsCanTalk() const [[nodiscard]] bool getSpectatorsCanTalk() const
{ {
return spectatorsCanTalk; return spectatorsCanTalk;
} }
bool getSpectatorsCanSeeEverything() const [[nodiscard]] bool getSpectatorsCanSeeEverything() const
{ {
return spectatorsCanSeeEverything; return spectatorsCanSeeEverything;
} }
int getDefaultStartingLifeTotal() const [[nodiscard]] int getDefaultStartingLifeTotal() const
{ {
return defaultStartingLifeTotal; return defaultStartingLifeTotal;
} }
bool getShareDecklistsOnLoad() const [[nodiscard]] bool getShareDecklistsOnLoad() const
{ {
return shareDecklistsOnLoad; return shareDecklistsOnLoad;
} }
bool getCreateGameAsSpectator() const [[nodiscard]] bool getCreateGameAsSpectator() const
{ {
return createGameAsSpectator; return createGameAsSpectator;
} }
bool getRememberGameSettings() const [[nodiscard]] bool getRememberGameSettings() const
{ {
return rememberGameSettings; return rememberGameSettings;
} }
int getKeepAlive() const override [[nodiscard]] int getKeepAlive() const override
{ {
return keepalive; return keepalive;
} }
int getTimeOut() const override [[nodiscard]] int getTimeOut() const override
{ {
return timeout; return timeout;
} }
int getMaxFontSize() const [[nodiscard]] int getMaxFontSize() const
{ {
return maxFontSize; return maxFontSize;
} }
@@ -901,73 +901,73 @@ public:
{ {
return useTearOffMenus; return useTearOffMenus;
} }
int getCardViewInitialRowsMax() const [[nodiscard]] int getCardViewInitialRowsMax() const
{ {
return cardViewInitialRowsMax; return cardViewInitialRowsMax;
} }
int getCardViewExpandedRowsMax() const [[nodiscard]] int getCardViewExpandedRowsMax() const
{ {
return cardViewExpandedRowsMax; return cardViewExpandedRowsMax;
} }
bool getCloseEmptyCardView() const [[nodiscard]] bool getCloseEmptyCardView() const
{ {
return closeEmptyCardView; return closeEmptyCardView;
} }
bool getFocusCardViewSearchBar() const [[nodiscard]] bool getFocusCardViewSearchBar() const
{ {
return focusCardViewSearchBar; return focusCardViewSearchBar;
} }
ShortcutsSettings &shortcuts() const [[nodiscard]] ShortcutsSettings &shortcuts() const
{ {
return *shortcutsSettings; return *shortcutsSettings;
} }
CardDatabaseSettings *cardDatabase() const [[nodiscard]] CardDatabaseSettings *cardDatabase() const
{ {
return cardDatabaseSettings; return cardDatabaseSettings;
} }
ServersSettings &servers() const [[nodiscard]] ServersSettings &servers() const
{ {
return *serversSettings; return *serversSettings;
} }
MessageSettings &messages() const [[nodiscard]] MessageSettings &messages() const
{ {
return *messageSettings; return *messageSettings;
} }
GameFiltersSettings &gameFilters() const [[nodiscard]] GameFiltersSettings &gameFilters() const
{ {
return *gameFiltersSettings; return *gameFiltersSettings;
} }
LayoutsSettings &layouts() const [[nodiscard]] LayoutsSettings &layouts() const
{ {
return *layoutsSettings; return *layoutsSettings;
} }
DownloadSettings &downloads() const [[nodiscard]] DownloadSettings &downloads() const
{ {
return *downloadSettings; return *downloadSettings;
} }
RecentsSettings &recents() const [[nodiscard]] RecentsSettings &recents() const
{ {
return *recentsSettings; return *recentsSettings;
} }
CardOverrideSettings &cardOverrides() const [[nodiscard]] CardOverrideSettings &cardOverrides() const
{ {
return *cardOverrideSettings; return *cardOverrideSettings;
} }
DebugSettings &debug() const [[nodiscard]] DebugSettings &debug() const
{ {
return *debugSettings; return *debugSettings;
} }
CardCounterSettings &cardCounters() const; [[nodiscard]] CardCounterSettings &cardCounters() const;
bool getIsPortableBuild() const [[nodiscard]] bool getIsPortableBuild() const
{ {
return isPortableBuild; return isPortableBuild;
} }
bool getDownloadSpoilersStatus() const [[nodiscard]] bool getDownloadSpoilersStatus() const
{ {
return mbDownloadSpoilers; return mbDownloadSpoilers;
} }
bool getRoundCardCorners() const [[nodiscard]] bool getRoundCardCorners() const
{ {
return roundCardCorners; return roundCardCorners;
} }

View File

@@ -20,9 +20,9 @@ class CardCounterSettings : public SettingsManager
public: public:
CardCounterSettings(const QString &settingsPath, QObject *parent = nullptr); CardCounterSettings(const QString &settingsPath, QObject *parent = nullptr);
QColor color(int counterId) const; [[nodiscard]] QColor color(int counterId) const;
QString displayName(int counterId) const; [[nodiscard]] QString displayName(int counterId) const;
public slots: public slots:
void setColor(int counterId, const QColor &color); void setColor(int counterId, const QColor &color);

View File

@@ -22,7 +22,7 @@ public:
explicit ShortcutFilterProxyModel(QObject *parent = nullptr); explicit ShortcutFilterProxyModel(QObject *parent = nullptr);
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
}; };
class ShortcutTreeView : public QTreeView class ShortcutTreeView : public QTreeView

View File

@@ -100,11 +100,11 @@ public:
{ {
QList::operator=(_sequence); QList::operator=(_sequence);
}; };
QString getName() const [[nodiscard]] QString getName() const
{ {
return QApplication::translate("shortcutsTab", name.toUtf8().data()); return QApplication::translate("shortcutsTab", name.toUtf8().data());
}; };
QString getGroupName() const [[nodiscard]] QString getGroupName() const
{ {
return ShortcutGroup::getGroupName(group); return ShortcutGroup::getGroupName(group);
}; };
@@ -120,13 +120,13 @@ class ShortcutsSettings : public QObject
public: public:
explicit ShortcutsSettings(const QString &settingsFilePath, QObject *parent = nullptr); explicit ShortcutsSettings(const QString &settingsFilePath, QObject *parent = nullptr);
ShortcutKey getDefaultShortcut(const QString &name) const; [[nodiscard]] ShortcutKey getDefaultShortcut(const QString &name) const;
ShortcutKey getShortcut(const QString &name) const; [[nodiscard]] ShortcutKey getShortcut(const QString &name) const;
QKeySequence getSingleShortcut(const QString &name) const; [[nodiscard]] QKeySequence getSingleShortcut(const QString &name) const;
QString getDefaultShortcutString(const QString &name) const; [[nodiscard]] QString getDefaultShortcutString(const QString &name) const;
QString getShortcutString(const QString &name) const; [[nodiscard]] QString getShortcutString(const QString &name) const;
QString getShortcutFriendlyName(const QString &shortcutName) const; [[nodiscard]] QString getShortcutFriendlyName(const QString &shortcutName) const;
QList<QString> getAllShortcutKeys() const [[nodiscard]] QList<QString> getAllShortcutKeys() const
{ {
return shortCuts.keys(); return shortCuts.keys();
}; };
@@ -135,9 +135,9 @@ public:
void setShortcuts(const QString &name, const QKeySequence &Sequence); void setShortcuts(const QString &name, const QKeySequence &Sequence);
void setShortcuts(const QString &name, const QString &sequences); void setShortcuts(const QString &name, const QString &sequences);
bool isKeyAllowed(const QString &name, const QString &sequences) const; [[nodiscard]] bool isKeyAllowed(const QString &name, const QString &sequences) const;
bool isValid(const QString &name, const QString &sequences) const; [[nodiscard]] bool isValid(const QString &name, const QString &sequences) const;
QStringList findOverlaps(const QString &name, const QString &sequences) const; [[nodiscard]] QStringList findOverlaps(const QString &name, const QString &sequences) const;
void resetAllShortcuts(); void resetAllShortcuts();
void clearAllShortcuts(); void clearAllShortcuts();
@@ -152,8 +152,8 @@ private:
QString settingsFilePath; QString settingsFilePath;
QHash<QString, ShortcutKey> shortCuts; QHash<QString, ShortcutKey> shortCuts;
QString stringifySequence(const QList<QKeySequence> &Sequence) const; [[nodiscard]] QString stringifySequence(const QList<QKeySequence> &Sequence) const;
QList<QKeySequence> parseSequenceString(const QString &stringSequence) const; [[nodiscard]] QList<QKeySequence> parseSequenceString(const QString &stringSequence) const;
const QHash<QString, ShortcutKey> defaultShortCuts = { const QHash<QString, ShortcutKey> defaultShortCuts = {
{"MainWindow/aCheckCardUpdates", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Check for Card Updates..."), {"MainWindow/aCheckCardUpdates", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Check for Card Updates..."),

View File

@@ -7,12 +7,12 @@
class SettingsCardPreferenceProvider : public ICardPreferenceProvider class SettingsCardPreferenceProvider : public ICardPreferenceProvider
{ {
public: public:
QString getCardPreferenceOverride(const QString &cardName) const override [[nodiscard]] QString getCardPreferenceOverride(const QString &cardName) const override
{ {
return SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardName); return SettingsCache::instance().cardOverrides().getCardPreferenceOverride(cardName);
} }
bool getIncludeRebalancedCards() const override [[nodiscard]] bool getIncludeRebalancedCards() const override
{ {
return SettingsCache::instance().getIncludeRebalancedCards(); return SettingsCache::instance().getIncludeRebalancedCards();
}; };

View File

@@ -40,7 +40,7 @@ public:
return filter(deck, info); return filter(deck, info);
} }
bool valid() const [[nodiscard]] bool valid() const
{ {
return _error.isEmpty(); return _error.isEmpty();
} }

View File

@@ -24,8 +24,8 @@ public slots:
void addFilter(const CardFilter *f); void addFilter(const CardFilter *f);
void removeFilter(const CardFilter *f); void removeFilter(const CardFilter *f);
void clearFiltersOfType(CardFilter::Attr filterType); void clearFiltersOfType(CardFilter::Attr filterType);
QList<const CardFilter *> getFiltersOfType(CardFilter::Attr filterType) const; [[nodiscard]] QList<const CardFilter *> getFiltersOfType(CardFilter::Attr filterType) const;
QList<const CardFilter *> allFilters() const; [[nodiscard]] QList<const CardFilter *> allFilters() const;
private slots: private slots:
void proxyBeginInsertRow(const FilterTreeNode *, int); void proxyBeginInsertRow(const FilterTreeNode *, int);
@@ -34,23 +34,23 @@ private slots:
void proxyEndRemoveRow(const FilterTreeNode *, int); void proxyEndRemoveRow(const FilterTreeNode *, int);
private: private:
FilterTreeNode *indexToNode(const QModelIndex &idx) const; [[nodiscard]] FilterTreeNode *indexToNode(const QModelIndex &idx) const;
QModelIndex nodeIndex(const FilterTreeNode *node, int row, int column) const; QModelIndex nodeIndex(const FilterTreeNode *node, int row, int column) const;
public: public:
FilterTreeModel(QObject *parent = nullptr); FilterTreeModel(QObject *parent = nullptr);
~FilterTreeModel() override; ~FilterTreeModel() override;
FilterTree *filterTree() const [[nodiscard]] FilterTree *filterTree() const
{ {
return fTree; return fTree;
} }
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override; [[nodiscard]] int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
Qt::ItemFlags flags(const QModelIndex &index) const override; [[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
QModelIndex parent(const QModelIndex &ind) const override; [[nodiscard]] QModelIndex parent(const QModelIndex &ind) const override;
QModelIndex index(int row, int column, const QModelIndex &parent) const override; [[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent) const override;
bool removeRows(int row, int count, const QModelIndex &parent) override; bool removeRows(int row, int count, const QModelIndex &parent) override;
void clear(); void clear();
}; };

View File

@@ -42,7 +42,7 @@ public:
* *
* Uses a set of name variants and folder paths to attempt to locate the correct image. * Uses a set of name variants and folder paths to attempt to locate the correct image.
*/ */
QImage tryLoad(const ExactCard &toLoad) const; [[nodiscard]] QImage tryLoad(const ExactCard &toLoad) const;
private: private:
QString picsPath; ///< Path to standard card image folder QString picsPath; ///< Path to standard card image folder
@@ -72,7 +72,7 @@ private:
* Uses several filename patterns to match card images, in order from * Uses several filename patterns to match card images, in order from
* most-specific to least-specific. * most-specific to least-specific.
*/ */
QImage tryLoadCardImageFromDisk(const QString &setName, [[nodiscard]] QImage tryLoadCardImageFromDisk(const QString &setName,
const QString &correctedCardName, const QString &correctedCardName,
const QString &collectorNumber, const QString &collectorNumber,
const QString &providerId) const; const QString &providerId) const;

View File

@@ -56,7 +56,7 @@ public:
DeckLoader(const DeckLoader &) = delete; DeckLoader(const DeckLoader &) = delete;
DeckLoader &operator=(const DeckLoader &) = delete; DeckLoader &operator=(const DeckLoader &) = delete;
const QString &getLastFileName() const [[nodiscard]] const QString &getLastFileName() const
{ {
return lastFileName; return lastFileName;
} }
@@ -64,16 +64,16 @@ public:
{ {
lastFileName = _lastFileName; lastFileName = _lastFileName;
} }
FileFormat getLastFileFormat() const [[nodiscard]] FileFormat getLastFileFormat() const
{ {
return lastFileFormat; return lastFileFormat;
} }
int getLastRemoteDeckId() const [[nodiscard]] int getLastRemoteDeckId() const
{ {
return lastRemoteDeckId; return lastRemoteDeckId;
} }
bool hasNotBeenLoaded() const [[nodiscard]] bool hasNotBeenLoaded() const
{ {
return getLastFileName().isEmpty() && getLastRemoteDeckId() == -1; return getLastFileName().isEmpty() && getLastRemoteDeckId() == -1;
} }

View File

@@ -23,9 +23,9 @@ public:
~FlowLayout() override; ~FlowLayout() override;
void insertWidgetAtIndex(QWidget *toInsert, int index); void insertWidgetAtIndex(QWidget *toInsert, int index);
QSize calculateMinimumSizeHorizontal() const; [[nodiscard]] QSize calculateMinimumSizeHorizontal() const;
QSize calculateSizeHintVertical() const; [[nodiscard]] QSize calculateSizeHintVertical() const;
QSize calculateMinimumSizeVertical() const; [[nodiscard]] QSize calculateMinimumSizeVertical() const;
void addItem(QLayoutItem *item) override; void addItem(QLayoutItem *item) override;
[[nodiscard]] int count() const override; [[nodiscard]] int count() const override;
[[nodiscard]] QLayoutItem *itemAt(int index) const override; [[nodiscard]] QLayoutItem *itemAt(int index) const override;
@@ -48,7 +48,7 @@ public:
void layoutSingleColumn(const QVector<QLayoutItem *> &colItems, int x, int y); void layoutSingleColumn(const QVector<QLayoutItem *> &colItems, int x, int y);
[[nodiscard]] QSize sizeHint() const override; [[nodiscard]] QSize sizeHint() const override;
[[nodiscard]] QSize minimumSize() const override; [[nodiscard]] QSize minimumSize() const override;
QSize calculateSizeHintHorizontal() const; [[nodiscard]] QSize calculateSizeHintHorizontal() const;
protected: protected:
QList<QLayoutItem *> items; // List to store layout items QList<QLayoutItem *> items; // List to store layout items

View File

@@ -104,7 +104,7 @@ private:
QAction *aRemoveCard, *aIncrement, *aDecrement, *aSwapCard; QAction *aRemoveCard, *aIncrement, *aDecrement, *aSwapCard;
void recursiveExpand(const QModelIndex &index); void recursiveExpand(const QModelIndex &index);
QModelIndexList getSelectedCardNodes() const; [[nodiscard]] QModelIndexList getSelectedCardNodes() const;
private slots: private slots:
void decklistCustomMenu(QPoint point); void decklistCustomMenu(QPoint point);

View File

@@ -22,7 +22,7 @@ public:
explicit DialogConvertDeckToCodFormat(QWidget *parent); explicit DialogConvertDeckToCodFormat(QWidget *parent);
void retranslateUi(); void retranslateUi();
bool dontAskAgain() const; [[nodiscard]] bool dontAskAgain() const;
private: private:
QVBoxLayout *layout; QVBoxLayout *layout;

View File

@@ -20,11 +20,11 @@ class DlgEditPassword : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DlgEditPassword(QWidget *parent = nullptr); explicit DlgEditPassword(QWidget *parent = nullptr);
QString getOldPassword() const [[nodiscard]] QString getOldPassword() const
{ {
return oldPasswordEdit->text(); return oldPasswordEdit->text();
} }
QString getNewPassword() const [[nodiscard]] QString getNewPassword() const
{ {
return newPasswordEdit->text(); return newPasswordEdit->text();
} }

View File

@@ -58,32 +58,32 @@ public:
const GamesProxyModel *_gamesProxyModel, const GamesProxyModel *_gamesProxyModel,
QWidget *parent = nullptr); QWidget *parent = nullptr);
bool getHideFullGames() const; [[nodiscard]] bool getHideFullGames() const;
bool getHideGamesThatStarted() const; [[nodiscard]] bool getHideGamesThatStarted() const;
bool getHidePasswordProtectedGames() const; [[nodiscard]] bool getHidePasswordProtectedGames() const;
void setShowPasswordProtectedGames(bool _passwordProtectedGamesHidden); void setShowPasswordProtectedGames(bool _passwordProtectedGamesHidden);
bool getHideBuddiesOnlyGames() const; [[nodiscard]] bool getHideBuddiesOnlyGames() const;
void setHideBuddiesOnlyGames(bool _hideBuddiesOnlyGames); void setHideBuddiesOnlyGames(bool _hideBuddiesOnlyGames);
bool getHideOpenDecklistGames() const; [[nodiscard]] bool getHideOpenDecklistGames() const;
void setHideOpenDecklistGames(bool _hideOpenDecklistGames); void setHideOpenDecklistGames(bool _hideOpenDecklistGames);
bool getHideIgnoredUserGames() const; [[nodiscard]] bool getHideIgnoredUserGames() const;
void setHideIgnoredUserGames(bool _hideIgnoredUserGames); void setHideIgnoredUserGames(bool _hideIgnoredUserGames);
bool getHideNotBuddyCreatedGames() const; [[nodiscard]] bool getHideNotBuddyCreatedGames() const;
QString getGameNameFilter() const; [[nodiscard]] QString getGameNameFilter() const;
void setGameNameFilter(const QString &_gameNameFilter); void setGameNameFilter(const QString &_gameNameFilter);
QStringList getCreatorNameFilters() const; [[nodiscard]] QStringList getCreatorNameFilters() const;
void setCreatorNameFilter(const QString &_creatorNameFilter); void setCreatorNameFilter(const QString &_creatorNameFilter);
QSet<int> getGameTypeFilter() const; [[nodiscard]] QSet<int> getGameTypeFilter() const;
void setGameTypeFilter(const QSet<int> &_gameTypeFilter); void setGameTypeFilter(const QSet<int> &_gameTypeFilter);
int getMaxPlayersFilterMin() const; [[nodiscard]] int getMaxPlayersFilterMin() const;
int getMaxPlayersFilterMax() const; [[nodiscard]] int getMaxPlayersFilterMax() const;
void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax); void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax);
QTime getMaxGameAge() const; [[nodiscard]] QTime getMaxGameAge() const;
const QMap<QTime, QString> gameAgeMap; const QMap<QTime, QString> gameAgeMap;
bool getShowOnlyIfSpectatorsCanWatch() const; [[nodiscard]] bool getShowOnlyIfSpectatorsCanWatch() const;
bool getShowSpectatorPasswordProtected() const; [[nodiscard]] bool getShowSpectatorPasswordProtected() const;
bool getShowOnlyIfSpectatorsCanChat() const; [[nodiscard]] bool getShowOnlyIfSpectatorsCanChat() const;
bool getShowOnlyIfSpectatorsCanSeeHands() const; [[nodiscard]] bool getShowOnlyIfSpectatorsCanSeeHands() const;
}; };
#endif #endif

View File

@@ -20,15 +20,15 @@ class DlgForgotPasswordRequest : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DlgForgotPasswordRequest(QWidget *parent = nullptr); explicit DlgForgotPasswordRequest(QWidget *parent = nullptr);
QString getHost() const [[nodiscard]] QString getHost() const
{ {
return hostEdit->text(); return hostEdit->text();
} }
int getPort() const [[nodiscard]] int getPort() const
{ {
return portEdit->text().toInt(); return portEdit->text().toInt();
} }
QString getPlayerName() const [[nodiscard]] QString getPlayerName() const
{ {
return playernameEdit->text(); return playernameEdit->text();
} }

View File

@@ -20,23 +20,23 @@ class DlgForgotPasswordReset : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DlgForgotPasswordReset(QWidget *parent = nullptr); explicit DlgForgotPasswordReset(QWidget *parent = nullptr);
QString getHost() const [[nodiscard]] QString getHost() const
{ {
return hostEdit->text(); return hostEdit->text();
} }
int getPort() const [[nodiscard]] int getPort() const
{ {
return portEdit->text().toInt(); return portEdit->text().toInt();
} }
QString getPlayerName() const [[nodiscard]] QString getPlayerName() const
{ {
return playernameEdit->text(); return playernameEdit->text();
} }
QString getToken() const [[nodiscard]] QString getToken() const
{ {
return tokenEdit->text(); return tokenEdit->text();
} }
QString getPassword() const [[nodiscard]] QString getPassword() const
{ {
return newpasswordEdit->text(); return newpasswordEdit->text();
} }

View File

@@ -20,31 +20,31 @@ class DlgRegister : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DlgRegister(QWidget *parent = nullptr); explicit DlgRegister(QWidget *parent = nullptr);
QString getHost() const [[nodiscard]] QString getHost() const
{ {
return hostEdit->text(); return hostEdit->text();
} }
int getPort() const [[nodiscard]] int getPort() const
{ {
return portEdit->text().toInt(); return portEdit->text().toInt();
} }
QString getPlayerName() const [[nodiscard]] QString getPlayerName() const
{ {
return playernameEdit->text(); return playernameEdit->text();
} }
QString getPassword() const [[nodiscard]] QString getPassword() const
{ {
return passwordEdit->text(); return passwordEdit->text();
} }
QString getEmail() const [[nodiscard]] QString getEmail() const
{ {
return emailEdit->text(); return emailEdit->text();
} }
QString getCountry() const [[nodiscard]] QString getCountry() const
{ {
return countryEdit->currentIndex() == 0 ? "" : countryEdit->currentText(); return countryEdit->currentIndex() == 0 ? "" : countryEdit->currentText();
} }
QString getRealName() const [[nodiscard]] QString getRealName() const
{ {
return realnameEdit->text(); return realnameEdit->text();
} }

View File

@@ -14,19 +14,19 @@ class TipOfTheDay
{ {
public: public:
explicit TipOfTheDay(QString _title, QString _content, QString _imagePath, QDate _date); explicit TipOfTheDay(QString _title, QString _content, QString _imagePath, QDate _date);
QString getTitle() const [[nodiscard]] QString getTitle() const
{ {
return title; return title;
} }
QString getContent() const [[nodiscard]] QString getContent() const
{ {
return content; return content;
} }
QString getImagePath() const [[nodiscard]] QString getImagePath() const
{ {
return imagePath; return imagePath;
} }
QDate getDate() const [[nodiscard]] QDate getDate() const
{ {
return date; return date;
} }
@@ -51,8 +51,8 @@ public:
explicit TipsOfTheDay(QString xmlPath, QObject *parent = nullptr); explicit TipsOfTheDay(QString xmlPath, QObject *parent = nullptr);
~TipsOfTheDay() override; ~TipsOfTheDay() override;
TipOfTheDay getTip(int tipId); TipOfTheDay getTip(int tipId);
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
private: private:
QList<TipOfTheDay> *tipList; QList<TipOfTheDay> *tipList;

View File

@@ -60,10 +60,10 @@ public:
explicit ReplayTimelineWidget(QWidget *parent = nullptr); explicit ReplayTimelineWidget(QWidget *parent = nullptr);
void setTimeline(const QList<int> &_replayTimeline); void setTimeline(const QList<int> &_replayTimeline);
QSize sizeHint() const override; [[nodiscard]] QSize sizeHint() const override;
QSize minimumSizeHint() const override; [[nodiscard]] QSize minimumSizeHint() const override;
void setTimeScaleFactor(qreal _timeScaleFactor); void setTimeScaleFactor(qreal _timeScaleFactor);
int getCurrentEvent() const [[nodiscard]] int getCurrentEvent() const
{ {
return currentEvent; return currentEvent;
} }

View File

@@ -42,19 +42,20 @@ public:
*/ */
GamesModel(const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, QObject *parent = nullptr); GamesModel(const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override
{ {
return parent.isValid() ? 0 : gameList.size(); return parent.isValid() ? 0 : gameList.size();
} }
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override [[nodiscard]] int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override
{ {
return NUM_COLS; return NUM_COLS;
} }
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; [[nodiscard]] QVariant
headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
/** /**
* @brief Formats the game creation time into a human-readable string. * @brief Formats the game creation time into a human-readable string.
@@ -148,71 +149,71 @@ public:
explicit GamesProxyModel(QObject *parent = nullptr, const UserListProxy *_userListProxy = nullptr); explicit GamesProxyModel(QObject *parent = nullptr, const UserListProxy *_userListProxy = nullptr);
// Getters for filter parameters // Getters for filter parameters
bool getHideBuddiesOnlyGames() const [[nodiscard]] bool getHideBuddiesOnlyGames() const
{ {
return hideBuddiesOnlyGames; return hideBuddiesOnlyGames;
} }
bool getHideIgnoredUserGames() const [[nodiscard]] bool getHideIgnoredUserGames() const
{ {
return hideIgnoredUserGames; return hideIgnoredUserGames;
} }
bool getHideFullGames() const [[nodiscard]] bool getHideFullGames() const
{ {
return hideFullGames; return hideFullGames;
} }
bool getHideGamesThatStarted() const [[nodiscard]] bool getHideGamesThatStarted() const
{ {
return hideGamesThatStarted; return hideGamesThatStarted;
} }
bool getHidePasswordProtectedGames() const [[nodiscard]] bool getHidePasswordProtectedGames() const
{ {
return hidePasswordProtectedGames; return hidePasswordProtectedGames;
} }
bool getHideNotBuddyCreatedGames() const [[nodiscard]] bool getHideNotBuddyCreatedGames() const
{ {
return hideNotBuddyCreatedGames; return hideNotBuddyCreatedGames;
} }
bool getHideOpenDecklistGames() const [[nodiscard]] bool getHideOpenDecklistGames() const
{ {
return hideOpenDecklistGames; return hideOpenDecklistGames;
} }
QString getGameNameFilter() const [[nodiscard]] QString getGameNameFilter() const
{ {
return gameNameFilter; return gameNameFilter;
} }
QStringList getCreatorNameFilters() const [[nodiscard]] QStringList getCreatorNameFilters() const
{ {
return creatorNameFilters; return creatorNameFilters;
} }
QSet<int> getGameTypeFilter() const [[nodiscard]] QSet<int> getGameTypeFilter() const
{ {
return gameTypeFilter; return gameTypeFilter;
} }
int getMaxPlayersFilterMin() const [[nodiscard]] int getMaxPlayersFilterMin() const
{ {
return maxPlayersFilterMin; return maxPlayersFilterMin;
} }
int getMaxPlayersFilterMax() const [[nodiscard]] int getMaxPlayersFilterMax() const
{ {
return maxPlayersFilterMax; return maxPlayersFilterMax;
} }
const QTime &getMaxGameAge() const [[nodiscard]] const QTime &getMaxGameAge() const
{ {
return maxGameAge; return maxGameAge;
} }
bool getShowOnlyIfSpectatorsCanWatch() const [[nodiscard]] bool getShowOnlyIfSpectatorsCanWatch() const
{ {
return showOnlyIfSpectatorsCanWatch; return showOnlyIfSpectatorsCanWatch;
} }
bool getShowSpectatorPasswordProtected() const [[nodiscard]] bool getShowSpectatorPasswordProtected() const
{ {
return showSpectatorPasswordProtected; return showSpectatorPasswordProtected;
} }
bool getShowOnlyIfSpectatorsCanChat() const [[nodiscard]] bool getShowOnlyIfSpectatorsCanChat() const
{ {
return showOnlyIfSpectatorsCanChat; return showOnlyIfSpectatorsCanChat;
} }
bool getShowOnlyIfSpectatorsCanSeeHands() const [[nodiscard]] bool getShowOnlyIfSpectatorsCanSeeHands() const
{ {
return showOnlyIfSpectatorsCanSeeHands; return showOnlyIfSpectatorsCanSeeHands;
} }
@@ -328,7 +329,7 @@ public:
/** /**
* @brief Returns the number of games filtered out by the current filter. * @brief Returns the number of games filtered out by the current filter.
*/ */
int getNumFilteredGames() const; [[nodiscard]] int getNumFilteredGames() const;
/** /**
* @brief Resets all filter parameters to default values. * @brief Resets all filter parameters to default values.
@@ -338,7 +339,7 @@ public:
/** /**
* @brief Returns true if all filter parameters are set to their defaults. * @brief Returns true if all filter parameters are set to their defaults.
*/ */
bool areFilterParametersSetToDefaults() const; [[nodiscard]] bool areFilterParametersSetToDefaults() const;
/** /**
* @brief Loads filter parameters from persistent settings. * @brief Loads filter parameters from persistent settings.
@@ -358,8 +359,8 @@ public:
void refresh(); void refresh();
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
bool filterAcceptsRow(int sourceRow) const; [[nodiscard]] bool filterAcceptsRow(int sourceRow) const;
}; };
#endif #endif

View File

@@ -34,11 +34,11 @@ public:
{ {
} }
virtual ~Node() = default; virtual ~Node() = default;
DirectoryNode *getParent() const [[nodiscard]] DirectoryNode *getParent() const
{ {
return parent; return parent;
} }
QString getName() const [[nodiscard]] QString getName() const
{ {
return name; return name;
} }
@@ -49,9 +49,9 @@ public:
explicit DirectoryNode(const QString &_name = QString(), DirectoryNode *_parent = nullptr); explicit DirectoryNode(const QString &_name = QString(), DirectoryNode *_parent = nullptr);
~DirectoryNode() override; ~DirectoryNode() override;
void clearTree(); void clearTree();
QString getPath() const; [[nodiscard]] QString getPath() const;
DirectoryNode *getNodeByPath(QStringList path); DirectoryNode *getNodeByPath(QStringList path);
FileNode *getNodeById(int id) const; [[nodiscard]] FileNode *getNodeById(int id) const;
}; };
class FileNode : public Node class FileNode : public Node
{ {
@@ -64,17 +64,17 @@ public:
: Node(_name, _parent), id(_id), uploadTime(_uploadTime) : Node(_name, _parent), id(_id), uploadTime(_uploadTime)
{ {
} }
int getId() const [[nodiscard]] int getId() const
{ {
return id; return id;
} }
QDateTime getUploadTime() const [[nodiscard]] QDateTime getUploadTime() const
{ {
return uploadTime; return uploadTime;
} }
}; };
template <typename T> T getNode(const QModelIndex &index) const template <typename T> [[nodiscard]] T getNode(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return dynamic_cast<T>(root); return dynamic_cast<T>(root);
@@ -96,15 +96,16 @@ private slots:
public: public:
explicit RemoteDeckList_TreeModel(AbstractClient *_client, QObject *parent = nullptr); explicit RemoteDeckList_TreeModel(AbstractClient *_client, QObject *parent = nullptr);
~RemoteDeckList_TreeModel() override; ~RemoteDeckList_TreeModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override; [[nodiscard]] int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; [[nodiscard]] QVariant
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QModelIndex parent(const QModelIndex &index) const override; [[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; [[nodiscard]] QModelIndex parent(const QModelIndex &index) const override;
[[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
DirectoryNode *getRoot() const [[nodiscard]] DirectoryNode *getRoot() const
{ {
return root; return root;
} }
@@ -124,11 +125,11 @@ private:
public: public:
explicit RemoteDeckList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr); explicit RemoteDeckList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr);
RemoteDeckList_TreeModel::Node *getNode(const QModelIndex &ind) const; [[nodiscard]] RemoteDeckList_TreeModel::Node *getNode(const QModelIndex &ind) const;
RemoteDeckList_TreeModel::Node *getCurrentItem() const; [[nodiscard]] RemoteDeckList_TreeModel::Node *getCurrentItem() const;
QList<RemoteDeckList_TreeModel::Node *> getCurrentSelection() const; [[nodiscard]] QList<RemoteDeckList_TreeModel::Node *> getCurrentSelection() const;
RemoteDeckList_TreeModel::DirectoryNode *getNodeByPath(const QString &path) const; [[nodiscard]] RemoteDeckList_TreeModel::DirectoryNode *getNodeByPath(const QString &path) const;
RemoteDeckList_TreeModel::FileNode *getNodeById(int id) const; [[nodiscard]] RemoteDeckList_TreeModel::FileNode *getNodeById(int id) const;
void addFileToTree(const ServerInfo_DeckStorage_TreeItem &file, RemoteDeckList_TreeModel::DirectoryNode *parent); void addFileToTree(const ServerInfo_DeckStorage_TreeItem &file, RemoteDeckList_TreeModel::DirectoryNode *parent);
void addFolderToTree(const ServerInfo_DeckStorage_TreeItem &folder, void addFolderToTree(const ServerInfo_DeckStorage_TreeItem &folder,
RemoteDeckList_TreeModel::DirectoryNode *parent); RemoteDeckList_TreeModel::DirectoryNode *parent);

View File

@@ -35,7 +35,7 @@ private:
{ {
} }
virtual ~Node() = default; virtual ~Node() = default;
QString getName() const [[nodiscard]] QString getName() const
{ {
return name; return name;
} }
@@ -91,21 +91,22 @@ private slots:
public: public:
explicit RemoteReplayList_TreeModel(AbstractClient *_client, QObject *parent = nullptr); explicit RemoteReplayList_TreeModel(AbstractClient *_client, QObject *parent = nullptr);
~RemoteReplayList_TreeModel() override; ~RemoteReplayList_TreeModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override [[nodiscard]] int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override
{ {
return numberOfColumns; return numberOfColumns;
} }
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; [[nodiscard]] QVariant
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QModelIndex parent(const QModelIndex &index) const override; [[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; [[nodiscard]] QModelIndex parent(const QModelIndex &index) const override;
[[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
void clearTree(); void clearTree();
void refreshTree(); void refreshTree();
ServerInfo_Replay const *getReplay(const QModelIndex &index) const; [[nodiscard]] ServerInfo_Replay const *getReplay(const QModelIndex &index) const;
ServerInfo_ReplayMatch const *getReplayMatch(const QModelIndex &index) const; [[nodiscard]] ServerInfo_ReplayMatch const *getReplayMatch(const QModelIndex &index) const;
ServerInfo_ReplayMatch const *getEnclosingReplayMatch(const QModelIndex &index) const; [[nodiscard]] ServerInfo_ReplayMatch const *getEnclosingReplayMatch(const QModelIndex &index) const;
void addMatchInfo(const ServerInfo_ReplayMatch &matchInfo); void addMatchInfo(const ServerInfo_ReplayMatch &matchInfo);
void updateMatchInfo(int gameId, const ServerInfo_ReplayMatch &matchInfo); void updateMatchInfo(int gameId, const ServerInfo_ReplayMatch &matchInfo);
void removeMatchInfo(int gameId); void removeMatchInfo(int gameId);
@@ -119,10 +120,10 @@ private:
public: public:
explicit RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr); explicit RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr);
ServerInfo_Replay const *getReplay(const QModelIndex &ind) const; [[nodiscard]] ServerInfo_Replay const *getReplay(const QModelIndex &ind) const;
ServerInfo_ReplayMatch const *getReplayMatch(const QModelIndex &ind) const; [[nodiscard]] ServerInfo_ReplayMatch const *getReplayMatch(const QModelIndex &ind) const;
QList<ServerInfo_Replay const *> getSelectedReplays() const; [[nodiscard]] QList<ServerInfo_Replay const *> getSelectedReplays() const;
QSet<ServerInfo_ReplayMatch const *> getSelectedReplayMatches() const; [[nodiscard]] QSet<ServerInfo_ReplayMatch const *> getSelectedReplayMatches() const;
void clearTree() void clearTree()
{ {
treeModel->clearTree(); treeModel->clearTree();

View File

@@ -30,31 +30,31 @@ private:
public: public:
UserConnection_Information(); UserConnection_Information();
UserConnection_Information(QString, QString, QString, QString, QString, bool, QString); UserConnection_Information(QString, QString, QString, QString, QString, bool, QString);
QString getSaveName() const [[nodiscard]] QString getSaveName() const
{ {
return saveName; return saveName;
} }
QString getServer() const [[nodiscard]] QString getServer() const
{ {
return server; return server;
} }
QString getPort() const [[nodiscard]] QString getPort() const
{ {
return port; return port;
} }
QString getUsername() const [[nodiscard]] QString getUsername() const
{ {
return username; return username;
} }
QString getPassword() const [[nodiscard]] QString getPassword() const
{ {
return password; return password;
} }
bool getSavePassword() const [[nodiscard]] bool getSavePassword() const
{ {
return savePassword; return savePassword;
} }
QString getSite() const [[nodiscard]] QString getSite() const
{ {
return site; return site;
} }

View File

@@ -60,11 +60,11 @@ public:
return ignoredUsers; return ignoredUsers;
} }
bool isOwnUserRegistered() const override; [[nodiscard]] bool isOwnUserRegistered() const override;
QString getOwnUsername() const override; [[nodiscard]] QString getOwnUsername() const override;
bool isUserBuddy(const QString &userName) const override; [[nodiscard]] bool isUserBuddy(const QString &userName) const override;
bool isUserIgnored(const QString &userName) const override; [[nodiscard]] bool isUserIgnored(const QString &userName) const override;
const ServerInfo_User *getOnlineUser(const QString &userName) const override; [[nodiscard]] const ServerInfo_User *getOnlineUser(const QString &userName) const override;
public slots: public slots:
void handleConnect(); void handleConnect();

View File

@@ -45,13 +45,13 @@ private slots:
public: public:
explicit BanDialog(const ServerInfo_User &info, QWidget *parent = nullptr); explicit BanDialog(const ServerInfo_User &info, QWidget *parent = nullptr);
QString getBanName() const; [[nodiscard]] QString getBanName() const;
QString getBanIP() const; [[nodiscard]] QString getBanIP() const;
QString getBanId() const; [[nodiscard]] QString getBanId() const;
int getMinutes() const; [[nodiscard]] int getMinutes() const;
QString getReason() const; [[nodiscard]] QString getReason() const;
QString getVisibleReason() const; [[nodiscard]] QString getVisibleReason() const;
int getDeleteMessages() const; [[nodiscard]] int getDeleteMessages() const;
}; };
class WarningDialog : public QDialog class WarningDialog : public QDialog
@@ -68,10 +68,10 @@ private slots:
public: public:
WarningDialog(const QString userName, const QString clientID, QWidget *parent = nullptr); WarningDialog(const QString userName, const QString clientID, QWidget *parent = nullptr);
QString getName() const; [[nodiscard]] QString getName() const;
QString getWarnID() const; [[nodiscard]] QString getWarnID() const;
QString getReason() const; [[nodiscard]] QString getReason() const;
int getDeleteMessages() const; [[nodiscard]] int getDeleteMessages() const;
void addWarningOption(const QString warning); void addWarningOption(const QString warning);
}; };
@@ -85,11 +85,11 @@ private:
public: public:
explicit AdminNotesDialog(const QString &_userName, const QString &_notes, QWidget *_parent = nullptr); explicit AdminNotesDialog(const QString &_userName, const QString &_notes, QWidget *_parent = nullptr);
QString getName() const [[nodiscard]] QString getName() const
{ {
return userName; return userName;
} }
QString getNotes() const; [[nodiscard]] QString getNotes() const;
}; };
class UserListItemDelegate : public QStyledItemDelegate class UserListItemDelegate : public QStyledItemDelegate
@@ -159,7 +159,7 @@ public:
void processUserInfo(const ServerInfo_User &user, bool online); void processUserInfo(const ServerInfo_User &user, bool online);
bool deleteUser(const QString &userName); bool deleteUser(const QString &userName);
void setUserOnline(const QString &userName, bool online); void setUserOnline(const QString &userName, bool online);
const QMap<QString, UserListTWI *> &getUsers() const [[nodiscard]] const QMap<QString, UserListTWI *> &getUsers() const
{ {
return users; return users;
} }

View File

@@ -29,27 +29,27 @@ public:
void debugPrint() const; void debugPrint() const;
// Getter methods for deck container // Getter methods for deck container
const QString &getDescription() const [[nodiscard]] const QString &getDescription() const
{ {
return description; return description;
} }
const QVector<QJsonObject> &getBreadcrumb() const [[nodiscard]] const QVector<QJsonObject> &getBreadcrumb() const
{ {
return breadcrumb; return breadcrumb;
} }
const EdhrecCommanderApiResponseCommanderDetails &getCommanderDetails() const [[nodiscard]] const EdhrecCommanderApiResponseCommanderDetails &getCommanderDetails() const
{ {
return card; return card;
} }
const QVector<EdhrecApiResponseCardList> &getCardlists() const [[nodiscard]] const QVector<EdhrecApiResponseCardList> &getCardlists() const
{ {
return cardlists; return cardlists;
} }
const QString &getKeywords() const [[nodiscard]] const QString &getKeywords() const
{ {
return keywords; return keywords;
} }
const QString &getTitle() const [[nodiscard]] const QString &getTitle() const
{ {
return title; return title;
} }

View File

@@ -27,119 +27,119 @@ public:
void debugPrint() const; void debugPrint() const;
// Getters for the card data // Getters for the card data
const QString &getAetherhubUri() const [[nodiscard]] const QString &getAetherhubUri() const
{ {
return aetherhubUri; return aetherhubUri;
} }
const QString &getArchidektUri() const [[nodiscard]] const QString &getArchidektUri() const
{ {
return archidektUri; return archidektUri;
} }
int getCmc() const [[nodiscard]] int getCmc() const
{ {
return cmc; return cmc;
} }
const QJsonArray &getColorIdentity() const [[nodiscard]] const QJsonArray &getColorIdentity() const
{ {
return colorIdentity; return colorIdentity;
} }
bool isCombos() const [[nodiscard]] bool isCombos() const
{ {
return combos; return combos;
} }
const QString &getDeckstatsUri() const [[nodiscard]] const QString &getDeckstatsUri() const
{ {
return deckstatsUri; return deckstatsUri;
} }
const QVector<QString> &getImageUris() const [[nodiscard]] const QVector<QString> &getImageUris() const
{ {
return imageUris; return imageUris;
} }
int getInclusion() const [[nodiscard]] int getInclusion() const
{ {
return inclusion; return inclusion;
} }
bool getIsCommander() const [[nodiscard]] bool getIsCommander() const
{ {
return isCommander; return isCommander;
} }
const QString &getLabel() const [[nodiscard]] const QString &getLabel() const
{ {
return label; return label;
} }
const QString &getLayout() const [[nodiscard]] const QString &getLayout() const
{ {
return layout; return layout;
} }
bool getLegalCommander() const [[nodiscard]] bool getLegalCommander() const
{ {
return legalCommander; return legalCommander;
} }
const QString &getMoxfieldUri() const [[nodiscard]] const QString &getMoxfieldUri() const
{ {
return moxfieldUri; return moxfieldUri;
} }
const QString &getMtggoldfishUri() const [[nodiscard]] const QString &getMtggoldfishUri() const
{ {
return mtggoldfishUri; return mtggoldfishUri;
} }
const QString &getName() const [[nodiscard]] const QString &getName() const
{ {
return name; return name;
} }
const QJsonArray &getNames() const [[nodiscard]] const QJsonArray &getNames() const
{ {
return names; return names;
} }
int getNumDecks() const [[nodiscard]] int getNumDecks() const
{ {
return numDecks; return numDecks;
} }
int getPotentialDecks() const [[nodiscard]] int getPotentialDecks() const
{ {
return potentialDecks; return potentialDecks;
} }
const QString &getPrecon() const [[nodiscard]] const QString &getPrecon() const
{ {
return precon; return precon;
} }
const CardPrices &getPrices() const [[nodiscard]] const CardPrices &getPrices() const
{ {
return prices; return prices;
} }
const QString &getPrimaryType() const [[nodiscard]] const QString &getPrimaryType() const
{ {
return primaryType; return primaryType;
} }
const QString &getRarity() const [[nodiscard]] const QString &getRarity() const
{ {
return rarity; return rarity;
} }
double getSalt() const [[nodiscard]] double getSalt() const
{ {
return salt; return salt;
} }
const QString &getSanitized() const [[nodiscard]] const QString &getSanitized() const
{ {
return sanitized; return sanitized;
} }
const QString &getSanitizedWo() const [[nodiscard]] const QString &getSanitizedWo() const
{ {
return sanitizedWo; return sanitizedWo;
} }
const QString &getScryfallUri() const [[nodiscard]] const QString &getScryfallUri() const
{ {
return scryfallUri; return scryfallUri;
} }
const QString &getSpellbookUri() const [[nodiscard]] const QString &getSpellbookUri() const
{ {
return spellbookUri; return spellbookUri;
} }
const QString &getType() const [[nodiscard]] const QString &getType() const
{ {
return type; return type;
} }
const QString &getUrl() const [[nodiscard]] const QString &getUrl() const
{ {
return url; return url;
} }

View File

@@ -27,13 +27,13 @@ public:
void retranslateUi() override; void retranslateUi() override;
void doSearch(); void doSearch();
QString getTabText() const override [[nodiscard]] QString getTabText() const override
{ {
auto cardName = cardToQuery.isNull() ? QString() : cardToQuery->getName(); auto cardName = cardToQuery.isNull() ? QString() : cardToQuery->getName();
return tr("EDHRec: ") + cardName; return tr("EDHRec: ") + cardName;
} }
CardSizeWidget *getCardSizeSlider() CardSizeWidget *getCardSizeSlider() const
{ {
return cardSizeSlider; return cardSizeSlider;
} }

View File

@@ -39,15 +39,15 @@ private:
public: public:
explicit Tab(TabSupervisor *_tabSupervisor); explicit Tab(TabSupervisor *_tabSupervisor);
const QList<QMenu *> &getTabMenus() const [[nodiscard]] const QList<QMenu *> &getTabMenus() const
{ {
return tabMenus; return tabMenus;
} }
TabSupervisor *getTabSupervisor() const [[nodiscard]] TabSupervisor *getTabSupervisor() const
{ {
return tabSupervisor; return tabSupervisor;
} }
bool getContentsChanged() const [[nodiscard]] bool getContentsChanged() const
{ {
return contentsChanged; return contentsChanged;
} }
@@ -55,7 +55,7 @@ public:
{ {
contentsChanged = _contentsChanged; contentsChanged = _contentsChanged;
} }
virtual QString getTabText() const = 0; [[nodiscard]] virtual QString getTabText() const = 0;
virtual void retranslateUi() = 0; virtual void retranslateUi() = 0;
/** /**

View File

@@ -26,7 +26,7 @@ private:
public: public:
TabHome(TabSupervisor *_tabSupervisor, AbstractClient *_client); TabHome(TabSupervisor *_tabSupervisor, AbstractClient *_client);
void retranslateUi() override; void retranslateUi() override;
QString getTabText() const override [[nodiscard]] QString getTabText() const override
{ {
return tr("Home"); return tr("Home");
} }

View File

@@ -54,8 +54,8 @@ public:
~TabMessage() override; ~TabMessage() override;
void retranslateUi() override; void retranslateUi() override;
void tabActivated() override; void tabActivated() override;
QString getUserName() const; [[nodiscard]] QString getUserName() const;
QString getTabText() const override; [[nodiscard]] QString getTabText() const override;
void processUserMessageEvent(const Event_UserMessage &event); void processUserMessageEvent(const Event_UserMessage &event);

View File

@@ -30,12 +30,12 @@ public:
* @param tagName The name of the tag to display. * @param tagName The name of the tag to display.
*/ */
explicit DeckPreviewTagDisplayWidget(QWidget *parent = nullptr, const QString &tagName = ""); explicit DeckPreviewTagDisplayWidget(QWidget *parent = nullptr, const QString &tagName = "");
QSize sizeHint() const override; [[nodiscard]] QSize sizeHint() const override;
QString getTagName() const [[nodiscard]] QString getTagName() const
{ {
return tagName; return tagName;
} }
TagState getState() const [[nodiscard]] TagState getState() const
{ {
return state; return state;
} }

View File

@@ -159,7 +159,7 @@ public:
* *
* @return Shared pointer to the cloned CardInfo. * @return Shared pointer to the cloned CardInfo.
*/ */
CardInfoPtr clone() const [[nodiscard]] CardInfoPtr clone() const
{ {
auto newCardInfo = CardInfoPtr(new CardInfo(*this)); auto newCardInfo = CardInfoPtr(new CardInfo(*this));
newCardInfo->setSmartPointer(newCardInfo); // Set the smart pointer for the new instance newCardInfo->setSmartPointer(newCardInfo); // Set the smart pointer for the new instance
@@ -179,11 +179,11 @@ public:
} }
/** @name Basic Properties Accessors */ //@{ /** @name Basic Properties Accessors */ //@{
inline const QString &getName() const [[nodiscard]] inline const QString &getName() const
{ {
return name; return name;
} }
const QString &getSimpleName() const [[nodiscard]] const QString &getSimpleName() const
{ {
return simpleName; return simpleName;
} }
@@ -191,7 +191,7 @@ public:
{ {
return altNames; return altNames;
}; };
const QString &getText() const [[nodiscard]] const QString &getText() const
{ {
return text; return text;
} }
@@ -200,15 +200,15 @@ public:
text = _text; text = _text;
emit cardInfoChanged(smartThis); emit cardInfoChanged(smartThis);
} }
bool getIsToken() const [[nodiscard]] bool getIsToken() const
{ {
return isToken; return isToken;
} }
QStringList getProperties() const [[nodiscard]] QStringList getProperties() const
{ {
return properties.keys(); return properties.keys();
} }
QString getProperty(const QString &propertyName) const [[nodiscard]] QString getProperty(const QString &propertyName) const
{ {
return properties.value(propertyName).toString(); return properties.value(propertyName).toString();
} }
@@ -217,34 +217,34 @@ public:
properties.insert(_name, _value); properties.insert(_name, _value);
emit cardInfoChanged(smartThis); emit cardInfoChanged(smartThis);
} }
bool hasProperty(const QString &propertyName) const [[nodiscard]] bool hasProperty(const QString &propertyName) const
{ {
return properties.contains(propertyName); return properties.contains(propertyName);
} }
const SetToPrintingsMap &getSets() const [[nodiscard]] const SetToPrintingsMap &getSets() const
{ {
return setsToPrintings; return setsToPrintings;
} }
const QString &getSetsNames() const [[nodiscard]] const QString &getSetsNames() const
{ {
return setsNames; return setsNames;
} }
//@} //@}
/** @name Related Cards Accessors */ //@{ /** @name Related Cards Accessors */ //@{
const QList<CardRelation *> &getRelatedCards() const [[nodiscard]] const QList<CardRelation *> &getRelatedCards() const
{ {
return relatedCards; return relatedCards;
} }
const QList<CardRelation *> &getReverseRelatedCards() const [[nodiscard]] const QList<CardRelation *> &getReverseRelatedCards() const
{ {
return reverseRelatedCards; return reverseRelatedCards;
} }
const QList<CardRelation *> &getReverseRelatedCards2Me() const [[nodiscard]] const QList<CardRelation *> &getReverseRelatedCards2Me() const
{ {
return reverseRelatedCardsToMe; return reverseRelatedCardsToMe;
} }
QList<CardRelation *> getAllRelatedCards() const [[nodiscard]] QList<CardRelation *> getAllRelatedCards() const
{ {
QList<CardRelation *> result; QList<CardRelation *> result;
result.append(getRelatedCards()); result.append(getRelatedCards());
@@ -259,24 +259,24 @@ public:
//@} //@}
/** @name UI Positioning */ //@{ /** @name UI Positioning */ //@{
const UiAttributes &getUiAttributes() const [[nodiscard]] const UiAttributes &getUiAttributes() const
{ {
return uiAttributes; return uiAttributes;
} }
//@} //@}
const QChar getColorChar() const; [[nodiscard]] const QChar getColorChar() const;
/** @name Legacy/Convenience Property Accessors */ //@{ /** @name Legacy/Convenience Property Accessors */ //@{
const QString getCardType() const; [[nodiscard]] const QString getCardType() const;
void setCardType(const QString &value); void setCardType(const QString &value);
const QString getCmc() const; [[nodiscard]] const QString getCmc() const;
const QString getColors() const; [[nodiscard]] const QString getColors() const;
void setColors(const QString &value); void setColors(const QString &value);
const QString getLoyalty() const; [[nodiscard]] const QString getLoyalty() const;
const QString getMainCardType() const; [[nodiscard]] const QString getMainCardType() const;
const QString getManaCost() const; [[nodiscard]] const QString getManaCost() const;
const QString getPowTough() const; [[nodiscard]] const QString getPowTough() const;
void setPowTough(const QString &value); void setPowTough(const QString &value);
//@} //@}
@@ -287,7 +287,7 @@ public:
* *
* @return Corrected card name as a QString. * @return Corrected card name as a QString.
*/ */
QString getCorrectedName() const; [[nodiscard]] QString getCorrectedName() const;
/** /**
* @brief Adds a printing to a specific set. * @brief Adds a printing to a specific set.

View File

@@ -23,8 +23,8 @@ private:
QStringList m_properties; // List of properties to sort by QStringList m_properties; // List of properties to sort by
Qt::SortOrder m_order; Qt::SortOrder m_order;
QVariant getProperty(const CardInfoPtr &card, const QString &property) const; [[nodiscard]] QVariant getProperty(const CardInfoPtr &card, const QString &property) const;
bool compareVariants(const QVariant &a, const QVariant &b) const; [[nodiscard]] bool compareVariants(const QVariant &a, const QVariant &b) const;
}; };
#endif // CARD_INFO_COMPARATOR_H #endif // CARD_INFO_COMPARATOR_H

View File

@@ -110,7 +110,7 @@ private:
* @brief Collects custom card database paths recursively. * @brief Collects custom card database paths recursively.
* @return Sorted list of file paths to custom databases. * @return Sorted list of file paths to custom databases.
*/ */
QStringList collectCustomDatabasePaths() const; [[nodiscard]] QStringList collectCustomDatabasePaths() const;
private: private:
CardDatabase *database; /**< Non-owning pointer to the target CardDatabase. */ CardDatabase *database; /**< Non-owning pointer to the target CardDatabase. */

View File

@@ -65,7 +65,7 @@ public:
* *
* @return Pointer to the associated CardSet. * @return Pointer to the associated CardSet.
*/ */
CardSetPtr getSet() const [[nodiscard]] CardSetPtr getSet() const
{ {
return set; return set;
} }
@@ -75,7 +75,7 @@ public:
* *
* @return List of keys stored in the properties map. * @return List of keys stored in the properties map.
*/ */
QStringList getProperties() const [[nodiscard]] QStringList getProperties() const
{ {
return properties.keys(); return properties.keys();
} }
@@ -86,7 +86,7 @@ public:
* @param propertyName The key name of the property to query. * @param propertyName The key name of the property to query.
* @return The property value as a string, or an empty string if not set. * @return The property value as a string, or an empty string if not set.
*/ */
QString getProperty(const QString &propertyName) const [[nodiscard]] QString getProperty(const QString &propertyName) const
{ {
return properties.value(propertyName).toString(); return properties.value(propertyName).toString();
} }
@@ -109,14 +109,14 @@ public:
* *
* @return A string representing the providerID. * @return A string representing the providerID.
*/ */
QString getUuid() const; [[nodiscard]] QString getUuid() const;
/** /**
* @brief Returns the flavorName for this printing. * @brief Returns the flavorName for this printing.
* *
* @return The flavorName, or empty if it isn't present. * @return The flavorName, or empty if it isn't present.
*/ */
QString getFlavorName() const; [[nodiscard]] QString getFlavorName() const;
}; };
#endif // COCKATRICE_PRINTING_INFO_H #endif // COCKATRICE_PRINTING_INFO_H

View File

@@ -105,34 +105,34 @@ public:
* *
* @return Sanitized short name. * @return Sanitized short name.
*/ */
QString getCorrectedShortName() const; [[nodiscard]] QString getCorrectedShortName() const;
/// @return Short identifier of the set. /// @return Short identifier of the set.
QString getShortName() const [[nodiscard]] QString getShortName() const
{ {
return shortName; return shortName;
} }
/// @return Descriptive name of the set. /// @return Descriptive name of the set.
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.
QString getSetType() const [[nodiscard]] QString getSetType() const
{ {
return setType; return setType;
} }
/// @return Release date of the set. /// @return Release date of the set.
QDate getReleaseDate() const [[nodiscard]] QDate getReleaseDate() const
{ {
return releaseDate; return releaseDate;
} }
/// @return Priority level of the set. /// @return Priority level of the set.
Priority getPriority() const [[nodiscard]] Priority getPriority() const
{ {
return priority; return priority;
} }
@@ -182,7 +182,7 @@ public:
void loadSetOptions(); void loadSetOptions();
/// @return The sort key assigned to this set. /// @return The sort key assigned to this set.
int getSortKey() const [[nodiscard]] int getSortKey() const
{ {
return sortKey; return sortKey;
} }
@@ -194,7 +194,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.
bool getEnabled() const [[nodiscard]] bool getEnabled() const
{ {
return enabled; return enabled;
} }
@@ -206,7 +206,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.
bool getIsKnown() const [[nodiscard]] bool getIsKnown() const
{ {
return isknown; return isknown;
} }
@@ -222,7 +222,7 @@ public:
* *
* @return True if the long name, type, and release date are all empty. * @return True if the long name, type, and release date are all empty.
*/ */
bool getIsKnownIgnored() const [[nodiscard]] bool getIsKnownIgnored() const
{ {
return longName.length() + setType.length() + releaseDate.toString().length() == 0; return longName.length() + setType.length() + releaseDate.toString().length() == 0;
} }

View File

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

View File

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

View File

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

View File

@@ -56,20 +56,20 @@ public:
{ {
} }
Type type() const [[nodiscard]] Type type() const
{ {
return t; return t;
} }
const QString &term() const [[nodiscard]] const QString &term() const
{ {
return trm; return trm;
} }
Attr attr() const [[nodiscard]] Attr attr() const
{ {
return a; return a;
} }
QJsonObject toJson() const; [[nodiscard]] QJsonObject toJson() const;
static CardFilter *fromJson(const QJsonObject &json); static CardFilter *fromJson(const QJsonObject &json);
static const QString typeName(Type t); static const QString typeName(Type t);
static const QString attrName(Attr a); static const QString attrName(Attr a);

View File

@@ -35,7 +35,7 @@ class FilterString
public: public:
FilterString(); FilterString();
explicit FilterString(const QString &exp); explicit FilterString(const QString &exp);
bool check(const CardData &card) const [[nodiscard]] bool check(const CardData &card) const
{ {
if (card.isNull()) { if (card.isNull()) {
static CardInfoPtr blankCard = CardInfo::newInstance(""); static CardInfoPtr blankCard = CardInfo::newInstance("");

View File

@@ -24,7 +24,7 @@ public:
FilterTreeNode() : enabled(true) FilterTreeNode() : enabled(true)
{ {
} }
virtual bool isEnabled() const [[nodiscard]] virtual bool isEnabled() const
{ {
return enabled; return enabled;
} }
@@ -38,18 +38,18 @@ public:
enabled = false; enabled = false;
nodeChanged(); nodeChanged();
} }
virtual FilterTreeNode *parent() const [[nodiscard]] virtual FilterTreeNode *parent() const
{ {
return nullptr; return nullptr;
} }
virtual FilterTreeNode *nodeAt(int /* i */) const [[nodiscard]] virtual FilterTreeNode *nodeAt(int /* i */) const
{ {
return nullptr; return nullptr;
} }
virtual void deleteAt(int /* i */) virtual void deleteAt(int /* i */)
{ {
} }
virtual int childCount() const [[nodiscard]] virtual int childCount() const
{ {
return 0; return 0;
} }
@@ -57,15 +57,15 @@ public:
{ {
return -1; return -1;
} }
virtual int index() const [[nodiscard]] virtual int index() const
{ {
return (parent() != nullptr) ? parent()->childIndex(this) : -1; return (parent() != nullptr) ? parent()->childIndex(this) : -1;
} }
virtual const QString text() const [[nodiscard]] virtual const QString text() const
{ {
return QString(""); return QString("");
} }
virtual bool isLeaf() const [[nodiscard]] virtual bool isLeaf() const
{ {
return false; return false;
} }
@@ -104,9 +104,9 @@ protected:
public: public:
virtual ~FilterTreeBranch(); virtual ~FilterTreeBranch();
void removeFiltersByAttr(CardFilter::Attr filterType); void removeFiltersByAttr(CardFilter::Attr filterType);
FilterTreeNode *nodeAt(int i) const override; [[nodiscard]] FilterTreeNode *nodeAt(int i) const override;
void deleteAt(int i) override; void deleteAt(int i) override;
int childCount() const override [[nodiscard]] int childCount() const override
{ {
return childNodes.size(); return childNodes.size();
} }
@@ -127,10 +127,10 @@ public:
LogicMap(CardFilter::Attr a, FilterTree *parent) : p(parent), attr(a) LogicMap(CardFilter::Attr a, FilterTree *parent) : p(parent), attr(a)
{ {
} }
const FilterItemList *findTypeList(CardFilter::Type type) const; [[nodiscard]] const FilterItemList *findTypeList(CardFilter::Type type) const;
FilterItemList *typeList(CardFilter::Type type); FilterItemList *typeList(CardFilter::Type type);
FilterTreeNode *parent() const override; [[nodiscard]] FilterTreeNode *parent() const override;
const QString text() const override [[nodiscard]] const QString text() const override
{ {
return CardFilter::attrName(attr); return CardFilter::attrName(attr);
} }
@@ -148,25 +148,25 @@ public:
FilterItemList(CardFilter::Type t, LogicMap *parent) : p(parent), type(t) FilterItemList(CardFilter::Type t, LogicMap *parent) : p(parent), type(t)
{ {
} }
CardFilter::Attr attr() const [[nodiscard]] CardFilter::Attr attr() const
{ {
return p->attr; return p->attr;
} }
FilterTreeNode *parent() const override [[nodiscard]] FilterTreeNode *parent() const override
{ {
return p; return p;
} }
int termIndex(const QString &term) const; [[nodiscard]] int termIndex(const QString &term) const;
FilterTreeNode *termNode(const QString &term); FilterTreeNode *termNode(const QString &term);
const QString text() const override [[nodiscard]] const QString text() const override
{ {
return CardFilter::typeName(type); return CardFilter::typeName(type);
} }
bool testTypeAnd(CardInfoPtr info, CardFilter::Attr attr) const; [[nodiscard]] bool testTypeAnd(CardInfoPtr info, CardFilter::Attr attr) const;
bool testTypeAndNot(CardInfoPtr info, CardFilter::Attr attr) const; [[nodiscard]] bool testTypeAndNot(CardInfoPtr info, CardFilter::Attr attr) const;
bool testTypeOr(CardInfoPtr info, CardFilter::Attr attr) const; [[nodiscard]] bool testTypeOr(CardInfoPtr info, CardFilter::Attr attr) const;
bool testTypeOrNot(CardInfoPtr info, CardFilter::Attr attr) const; [[nodiscard]] bool testTypeOrNot(CardInfoPtr info, CardFilter::Attr attr) const;
}; };
class FilterItem : public FilterTreeNode class FilterItem : public FilterTreeNode
@@ -182,42 +182,42 @@ public:
} }
virtual ~FilterItem() = default; virtual ~FilterItem() = default;
CardFilter::Attr attr() const [[nodiscard]] CardFilter::Attr attr() const
{ {
return p->attr(); return p->attr();
} }
CardFilter::Type type() const [[nodiscard]] CardFilter::Type type() const
{ {
return p->type; return p->type;
} }
FilterTreeNode *parent() const override [[nodiscard]] FilterTreeNode *parent() const override
{ {
return p; return p;
} }
const QString text() const override [[nodiscard]] const QString text() const override
{ {
return term; return term;
} }
bool isLeaf() const override [[nodiscard]] bool isLeaf() const override
{ {
return true; return true;
} }
bool acceptName(CardInfoPtr info) const; [[nodiscard]] bool acceptName(CardInfoPtr info) const;
bool acceptType(CardInfoPtr info) const; [[nodiscard]] bool acceptType(CardInfoPtr info) const;
bool acceptMainType(CardInfoPtr info) const; [[nodiscard]] bool acceptMainType(CardInfoPtr info) const;
bool acceptSubType(CardInfoPtr info) const; [[nodiscard]] bool acceptSubType(CardInfoPtr info) const;
bool acceptColor(CardInfoPtr info) const; [[nodiscard]] bool acceptColor(CardInfoPtr info) const;
bool acceptText(CardInfoPtr info) const; [[nodiscard]] bool acceptText(CardInfoPtr info) const;
bool acceptSet(CardInfoPtr info) const; [[nodiscard]] bool acceptSet(CardInfoPtr info) const;
bool acceptManaCost(CardInfoPtr info) const; [[nodiscard]] bool acceptManaCost(CardInfoPtr info) const;
bool acceptCmc(CardInfoPtr info) const; [[nodiscard]] bool acceptCmc(CardInfoPtr info) const;
bool acceptPowerToughness(CardInfoPtr info, CardFilter::Attr attr) const; [[nodiscard]] bool acceptPowerToughness(CardInfoPtr info, CardFilter::Attr attr) const;
bool acceptLoyalty(CardInfoPtr info) const; [[nodiscard]] bool acceptLoyalty(CardInfoPtr info) const;
bool acceptRarity(CardInfoPtr info) const; [[nodiscard]] bool acceptRarity(CardInfoPtr info) const;
bool acceptCardAttr(CardInfoPtr info, CardFilter::Attr attr) const; [[nodiscard]] bool acceptCardAttr(CardInfoPtr info, CardFilter::Attr attr) const;
bool acceptFormat(CardInfoPtr info) const; [[nodiscard]] bool acceptFormat(CardInfoPtr info) const;
bool relationCheck(int cardInfo) const; [[nodiscard]] bool relationCheck(int cardInfo) const;
}; };
class FilterTree : public QObject, public FilterTreeBranch<LogicMap *> class FilterTree : public QObject, public FilterTreeBranch<LogicMap *>
@@ -265,16 +265,16 @@ public:
FilterTreeNode *termNode(CardFilter::Attr attr, CardFilter::Type type, const QString &term); FilterTreeNode *termNode(CardFilter::Attr attr, CardFilter::Type type, const QString &term);
FilterTreeNode *termNode(const CardFilter *f); FilterTreeNode *termNode(const CardFilter *f);
const QString text() const override [[nodiscard]] const QString text() const override
{ {
return QString("root"); return QString("root");
} }
int index() const override [[nodiscard]] int index() const override
{ {
return 0; return 0;
} }
bool acceptsCard(CardInfoPtr info) const; [[nodiscard]] bool acceptsCard(CardInfoPtr info) const;
void removeFiltersByAttr(CardFilter::Attr filterType); void removeFiltersByAttr(CardFilter::Attr filterType);
void removeFilter(const CardFilter *toRemove); void removeFilter(const CardFilter *toRemove);
void clear(); void clear();

View File

@@ -9,10 +9,10 @@ class ICardDatabasePathProvider : public QObject
public: public:
virtual ~ICardDatabasePathProvider() = default; virtual ~ICardDatabasePathProvider() = default;
virtual QString getCardDatabasePath() const = 0; [[nodiscard]] virtual QString getCardDatabasePath() const = 0;
virtual QString getCustomCardDatabasePath() const = 0; [[nodiscard]] virtual QString getCustomCardDatabasePath() const = 0;
virtual QString getTokenDatabasePath() const = 0; [[nodiscard]] virtual QString getTokenDatabasePath() const = 0;
virtual QString getSpoilerCardDatabasePath() const = 0; [[nodiscard]] virtual QString getSpoilerCardDatabasePath() const = 0;
signals: signals:
void cardDatabasePathChanged(); void cardDatabasePathChanged();

View File

@@ -7,8 +7,8 @@ class ICardPreferenceProvider
{ {
public: public:
virtual ~ICardPreferenceProvider() = default; virtual ~ICardPreferenceProvider() = default;
virtual QString getCardPreferenceOverride(const QString &cardName) const = 0; [[nodiscard]] virtual QString getCardPreferenceOverride(const QString &cardName) const = 0;
virtual bool getIncludeRebalancedCards() const = 0; [[nodiscard]] virtual bool getIncludeRebalancedCards() const = 0;
}; };
#endif // COCKATRICE_INTERFACE_CARD_PREFERENCE_PROVIDER_H #endif // COCKATRICE_INTERFACE_CARD_PREFERENCE_PROVIDER_H

View File

@@ -5,19 +5,19 @@
class NoopCardDatabasePathProvider : public ICardDatabasePathProvider class NoopCardDatabasePathProvider : public ICardDatabasePathProvider
{ {
public: public:
QString getCardDatabasePath() const override [[nodiscard]] QString getCardDatabasePath() const override
{ {
return ""; return "";
} }
QString getCustomCardDatabasePath() const override [[nodiscard]] QString getCustomCardDatabasePath() const override
{ {
return ""; return "";
} }
QString getTokenDatabasePath() const override [[nodiscard]] QString getTokenDatabasePath() const override
{ {
return ""; return "";
} }
QString getSpoilerCardDatabasePath() const override [[nodiscard]] QString getSpoilerCardDatabasePath() const override
{ {
return ""; return "";
} }

View File

@@ -5,12 +5,12 @@
class NoopCardPreferenceProvider : public ICardPreferenceProvider class NoopCardPreferenceProvider : public ICardPreferenceProvider
{ {
public: public:
QString getCardPreferenceOverride(const QString &) const override [[nodiscard]] QString getCardPreferenceOverride(const QString &) const override
{ {
return {}; return {};
} }
bool getIncludeRebalancedCards() const override [[nodiscard]] bool getIncludeRebalancedCards() const override
{ {
return true; return true;
} }

View File

@@ -16,7 +16,7 @@ public:
explicit CardCompleterProxyModel(QObject *parent = nullptr); explicit CardCompleterProxyModel(QObject *parent = nullptr);
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
}; };
#endif // CARD_COMPLETER_PROXY_MODEL_H #endif // CARD_COMPLETER_PROXY_MODEL_H

View File

@@ -17,8 +17,8 @@ class CardSearchModel : public QAbstractListModel
public: public:
explicit CardSearchModel(CardDatabaseDisplayModel *sourceModel, QObject *parent = nullptr); explicit CardSearchModel(CardDatabaseDisplayModel *sourceModel, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void updateSearchResults(const QString &query); // Update results based on input void updateSearchResults(const QString &query); // Update results based on input

View File

@@ -77,17 +77,17 @@ public:
dirtyTimer.start(20); dirtyTimer.start(20);
} }
void clearFilterAll(); void clearFilterAll();
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
bool canFetchMore(const QModelIndex &parent) const override; [[nodiscard]] bool canFetchMore(const QModelIndex &parent) const override;
void fetchMore(const QModelIndex &parent) override; void fetchMore(const QModelIndex &parent) override;
signals: signals:
void modelDirty(); void modelDirty();
protected: protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; [[nodiscard]] bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
static int lessThanNumerically(const QString &left, const QString &right); static int lessThanNumerically(const QString &left, const QString &right);
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
bool rowMatchesCardName(CardInfoPtr info) const; [[nodiscard]] bool rowMatchesCardName(CardInfoPtr info) const;
private slots: private slots:
void filterTreeChanged(); void filterTreeChanged();

View File

@@ -31,15 +31,16 @@ public:
}; };
CardDatabaseModel(CardDatabase *_db, bool _showOnlyCardsFromEnabledSets, QObject *parent = nullptr); CardDatabaseModel(CardDatabase *_db, bool _showOnlyCardsFromEnabledSets, QObject *parent = nullptr);
~CardDatabaseModel() override; ~CardDatabaseModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; [[nodiscard]] QVariant
CardDatabase *getDatabase() const headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
[[nodiscard]] CardDatabase *getDatabase() const
{ {
return db; return db;
} }
CardInfoPtr getCard(int index) const [[nodiscard]] CardInfoPtr getCard(int index) const
{ {
return cardList[index]; return cardList[index];
} }

View File

@@ -25,11 +25,11 @@ public:
SetsMimeData(int _oldRow) : oldRow(_oldRow) SetsMimeData(int _oldRow) : oldRow(_oldRow)
{ {
} }
int getOldRow() const [[nodiscard]] int getOldRow() const
{ {
return oldRow; return oldRow;
} }
QStringList formats() const [[nodiscard]] QStringList formats() const
{ {
return QStringList() << "application/x-cockatricecardset"; return QStringList() << "application/x-cockatricecardset";
} }
@@ -64,22 +64,23 @@ public:
explicit SetsModel(CardDatabase *_db, QObject *parent = nullptr); explicit SetsModel(CardDatabase *_db, QObject *parent = nullptr);
~SetsModel() override; ~SetsModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override [[nodiscard]] int columnCount(const QModelIndex &parent = QModelIndex()) const override
{ {
Q_UNUSED(parent); Q_UNUSED(parent);
return NUM_COLS; return NUM_COLS;
} }
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override; bool setData(const QModelIndex &index, const QVariant &value, int role) override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; [[nodiscard]] QVariant
Qt::ItemFlags flags(const QModelIndex &index) const override; headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
Qt::DropActions supportedDropActions() const override; [[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
[[nodiscard]] Qt::DropActions supportedDropActions() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override; [[nodiscard]] QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool bool
dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
QStringList mimeTypes() const override; [[nodiscard]] QStringList mimeTypes() const override;
void swapRows(int oldRow, int newRow); void swapRows(int oldRow, int newRow);
void toggleRow(int row, bool enable); void toggleRow(int row, bool enable);
void toggleRow(int row); void toggleRow(int row);
@@ -97,8 +98,8 @@ public:
explicit SetsDisplayModel(QObject *parent = nullptr); explicit SetsDisplayModel(QObject *parent = nullptr);
protected: protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; [[nodiscard]] bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
void fetchMore(const QModelIndex &index) override; void fetchMore(const QModelIndex &index) override;
}; };

View File

@@ -14,10 +14,10 @@ class TokenDisplayModel : public CardDatabaseDisplayModel
Q_OBJECT Q_OBJECT
public: public:
explicit TokenDisplayModel(QObject *parent = nullptr); explicit TokenDisplayModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
}; };
#endif // COCKATRICE_TOKEN_DISPLAY_MODEL_H #endif // COCKATRICE_TOKEN_DISPLAY_MODEL_H

View File

@@ -14,10 +14,10 @@ class TokenEditModel : public CardDatabaseDisplayModel
Q_OBJECT Q_OBJECT
public: public:
explicit TokenEditModel(QObject *parent = nullptr); explicit TokenEditModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override; [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; [[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
}; };
#endif // COCKATRICE_TOKEN_EDIT_MODEL_H #endif // COCKATRICE_TOKEN_EDIT_MODEL_H

View File

@@ -101,7 +101,7 @@ public:
: AbstractDecklistCardNode(_parent, position), dataNode(_dataNode) : AbstractDecklistCardNode(_parent, position), dataNode(_dataNode)
{ {
} }
int getNumber() const override [[nodiscard]] int getNumber() const override
{ {
return dataNode->getNumber(); return dataNode->getNumber();
} }
@@ -109,7 +109,7 @@ public:
{ {
dataNode->setNumber(_number); dataNode->setNumber(_number);
} }
QString getName() const override [[nodiscard]] QString getName() const override
{ {
return dataNode->getName(); return dataNode->getName();
} }
@@ -117,7 +117,7 @@ public:
{ {
dataNode->setName(_name); dataNode->setName(_name);
} }
QString getCardProviderId() const override [[nodiscard]] QString getCardProviderId() const override
{ {
return dataNode->getCardProviderId(); return dataNode->getCardProviderId();
} }
@@ -125,7 +125,7 @@ public:
{ {
dataNode->setCardProviderId(_cardProviderId); dataNode->setCardProviderId(_cardProviderId);
} }
QString getCardSetShortName() const override [[nodiscard]] QString getCardSetShortName() const override
{ {
return dataNode->getCardSetShortName(); return dataNode->getCardSetShortName();
} }
@@ -133,7 +133,7 @@ public:
{ {
dataNode->setCardSetShortName(_cardSetShortName); dataNode->setCardSetShortName(_cardSetShortName);
} }
QString getCardCollectorNumber() const override [[nodiscard]] QString getCardCollectorNumber() const override
{ {
return dataNode->getCardCollectorNumber(); return dataNode->getCardCollectorNumber();
} }
@@ -146,7 +146,7 @@ public:
* @brief Returns the underlying data node. * @brief Returns the underlying data node.
* @return Pointer to the DecklistCardNode wrapped by this node. * @return Pointer to the DecklistCardNode wrapped by this node.
*/ */
DecklistCardNode *getDataNode() const [[nodiscard]] DecklistCardNode *getDataNode() const
{ {
return dataNode; return dataNode;
} }
@@ -200,7 +200,7 @@ public:
* @brief Returns the root index of the model. * @brief Returns the root index of the model.
* @return QModelIndex representing the root node. * @return QModelIndex representing the root node.
*/ */
QModelIndex getRoot() const [[nodiscard]] QModelIndex getRoot() const
{ {
return nodeToIndex(root); return nodeToIndex(root);
}; };
@@ -210,17 +210,17 @@ public:
* @param info Pointer to card information. * @param info Pointer to card information.
* @return String representing the value of the current grouping criteria for the card. * @return String representing the value of the current grouping criteria for the card.
*/ */
QString getGroupCriteriaForCard(CardInfoPtr info) const; [[nodiscard]] QString getGroupCriteriaForCard(CardInfoPtr info) const;
// Qt model overrides // Qt model overrides
int rowCount(const QModelIndex &parent) const override; [[nodiscard]] int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override; [[nodiscard]] int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override; [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
void emitBackgroundUpdates(const QModelIndex &parent); void emitBackgroundUpdates(const QModelIndex &parent);
QVariant headerData(int section, Qt::Orientation orientation, int role) const override; [[nodiscard]] QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QModelIndex index(int row, int column, const QModelIndex &parent) const override; [[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent) const override;
QModelIndex parent(const QModelIndex &index) const override; [[nodiscard]] QModelIndex parent(const QModelIndex &index) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; [[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override; bool setData(const QModelIndex &index, const QVariant &value, int role) override;
bool removeRows(int row, int count, const QModelIndex &parent) override; bool removeRows(int row, int count, const QModelIndex &parent) override;
@@ -232,7 +232,7 @@ public:
* @param cardNumber Optional collector number. * @param cardNumber Optional collector number.
* @return QModelIndex of the card, or invalid index if not found. * @return QModelIndex of the card, or invalid index if not found.
*/ */
QModelIndex findCard(const QString &cardName, [[nodiscard]] QModelIndex findCard(const QString &cardName,
const QString &zoneName, const QString &zoneName,
const QString &providerId = "", const QString &providerId = "",
const QString &cardNumber = "") const; const QString &cardNumber = "") const;
@@ -269,15 +269,15 @@ public:
* @brief Removes all cards and resets the model. * @brief Removes all cards and resets the model.
*/ */
void cleanList(); void cleanList();
DeckList *getDeckList() const [[nodiscard]] DeckList *getDeckList() const
{ {
return deckList; return deckList;
} }
void setDeckList(DeckList *_deck); void setDeckList(DeckList *_deck);
QList<ExactCard> getCards() const; [[nodiscard]] QList<ExactCard> getCards() const;
QList<ExactCard> getCardsForZone(const QString &zoneName) const; [[nodiscard]] QList<ExactCard> getCardsForZone(const QString &zoneName) const;
QList<QString> *getZones() const; [[nodiscard]] QList<QString> *getZones() const;
/** /**
* @brief Sets the criteria used to group cards in the model. * @brief Sets the criteria used to group cards in the model.
@@ -294,7 +294,7 @@ private:
InnerDecklistNode *createNodeIfNeeded(const QString &name, InnerDecklistNode *parent); InnerDecklistNode *createNodeIfNeeded(const QString &name, InnerDecklistNode *parent);
QModelIndex nodeToIndex(AbstractDecklistNode *node) const; QModelIndex nodeToIndex(AbstractDecklistNode *node) const;
DecklistModelCardNode *findCardNode(const QString &cardName, [[nodiscard]] DecklistModelCardNode *findCardNode(const QString &cardName,
const QString &zoneName, const QString &zoneName,
const QString &providerId = "", const QString &providerId = "",
const QString &cardNumber = "") const; const QString &cardNumber = "") const;

View File

@@ -25,7 +25,7 @@ public:
} }
protected: protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; [[nodiscard]] bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
private: private:
QStringList sortCriteria; QStringList sortCriteria;

View File

@@ -13,7 +13,7 @@ public:
} }
virtual unsigned int rand(int min, int max) = 0; virtual unsigned int rand(int min, int max) = 0;
QVector<int> makeNumbersVector(int n, int min, int max); QVector<int> makeNumbersVector(int n, int min, int max);
double testRandom(const QVector<int> &numbers) const; [[nodiscard]] double testRandom(const QVector<int> &numbers) const;
}; };
extern RNG_Abstract *rng; extern RNG_Abstract *rng;

View File

@@ -57,7 +57,7 @@ private:
explicit GameFiltersSettings(const QString &settingPath, QObject *parent = nullptr); explicit GameFiltersSettings(const QString &settingPath, QObject *parent = nullptr);
GameFiltersSettings(const GameFiltersSettings & /*other*/); GameFiltersSettings(const GameFiltersSettings & /*other*/);
QString hashGameType(const QString &gameType) const; [[nodiscard]] QString hashGameType(const QString &gameType) const;
}; };
#endif // GAMEFILTERSSETTINGS_H #endif // GAMEFILTERSSETTINGS_H