mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
[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:
parent
a1a3b02d3a
commit
9ece4bfd9b
58 changed files with 548 additions and 543 deletions
|
|
@ -22,7 +22,7 @@ public:
|
|||
explicit DialogConvertDeckToCodFormat(QWidget *parent);
|
||||
void retranslateUi();
|
||||
|
||||
bool dontAskAgain() const;
|
||||
[[nodiscard]] bool dontAskAgain() const;
|
||||
|
||||
private:
|
||||
QVBoxLayout *layout;
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ class DlgEditPassword : public QDialog
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit DlgEditPassword(QWidget *parent = nullptr);
|
||||
QString getOldPassword() const
|
||||
[[nodiscard]] QString getOldPassword() const
|
||||
{
|
||||
return oldPasswordEdit->text();
|
||||
}
|
||||
QString getNewPassword() const
|
||||
[[nodiscard]] QString getNewPassword() const
|
||||
{
|
||||
return newPasswordEdit->text();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,32 +58,32 @@ public:
|
|||
const GamesProxyModel *_gamesProxyModel,
|
||||
QWidget *parent = nullptr);
|
||||
|
||||
bool getHideFullGames() const;
|
||||
bool getHideGamesThatStarted() const;
|
||||
bool getHidePasswordProtectedGames() const;
|
||||
[[nodiscard]] bool getHideFullGames() const;
|
||||
[[nodiscard]] bool getHideGamesThatStarted() const;
|
||||
[[nodiscard]] bool getHidePasswordProtectedGames() const;
|
||||
void setShowPasswordProtectedGames(bool _passwordProtectedGamesHidden);
|
||||
bool getHideBuddiesOnlyGames() const;
|
||||
[[nodiscard]] bool getHideBuddiesOnlyGames() const;
|
||||
void setHideBuddiesOnlyGames(bool _hideBuddiesOnlyGames);
|
||||
bool getHideOpenDecklistGames() const;
|
||||
[[nodiscard]] bool getHideOpenDecklistGames() const;
|
||||
void setHideOpenDecklistGames(bool _hideOpenDecklistGames);
|
||||
bool getHideIgnoredUserGames() const;
|
||||
[[nodiscard]] bool getHideIgnoredUserGames() const;
|
||||
void setHideIgnoredUserGames(bool _hideIgnoredUserGames);
|
||||
bool getHideNotBuddyCreatedGames() const;
|
||||
QString getGameNameFilter() const;
|
||||
[[nodiscard]] bool getHideNotBuddyCreatedGames() const;
|
||||
[[nodiscard]] QString getGameNameFilter() const;
|
||||
void setGameNameFilter(const QString &_gameNameFilter);
|
||||
QStringList getCreatorNameFilters() const;
|
||||
[[nodiscard]] QStringList getCreatorNameFilters() const;
|
||||
void setCreatorNameFilter(const QString &_creatorNameFilter);
|
||||
QSet<int> getGameTypeFilter() const;
|
||||
[[nodiscard]] QSet<int> getGameTypeFilter() const;
|
||||
void setGameTypeFilter(const QSet<int> &_gameTypeFilter);
|
||||
int getMaxPlayersFilterMin() const;
|
||||
int getMaxPlayersFilterMax() const;
|
||||
[[nodiscard]] int getMaxPlayersFilterMin() const;
|
||||
[[nodiscard]] int getMaxPlayersFilterMax() const;
|
||||
void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax);
|
||||
QTime getMaxGameAge() const;
|
||||
[[nodiscard]] QTime getMaxGameAge() const;
|
||||
const QMap<QTime, QString> gameAgeMap;
|
||||
bool getShowOnlyIfSpectatorsCanWatch() const;
|
||||
bool getShowSpectatorPasswordProtected() const;
|
||||
bool getShowOnlyIfSpectatorsCanChat() const;
|
||||
bool getShowOnlyIfSpectatorsCanSeeHands() const;
|
||||
[[nodiscard]] bool getShowOnlyIfSpectatorsCanWatch() const;
|
||||
[[nodiscard]] bool getShowSpectatorPasswordProtected() const;
|
||||
[[nodiscard]] bool getShowOnlyIfSpectatorsCanChat() const;
|
||||
[[nodiscard]] bool getShowOnlyIfSpectatorsCanSeeHands() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,15 +20,15 @@ class DlgForgotPasswordRequest : public QDialog
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit DlgForgotPasswordRequest(QWidget *parent = nullptr);
|
||||
QString getHost() const
|
||||
[[nodiscard]] QString getHost() const
|
||||
{
|
||||
return hostEdit->text();
|
||||
}
|
||||
int getPort() const
|
||||
[[nodiscard]] int getPort() const
|
||||
{
|
||||
return portEdit->text().toInt();
|
||||
}
|
||||
QString getPlayerName() const
|
||||
[[nodiscard]] QString getPlayerName() const
|
||||
{
|
||||
return playernameEdit->text();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,23 +20,23 @@ class DlgForgotPasswordReset : public QDialog
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit DlgForgotPasswordReset(QWidget *parent = nullptr);
|
||||
QString getHost() const
|
||||
[[nodiscard]] QString getHost() const
|
||||
{
|
||||
return hostEdit->text();
|
||||
}
|
||||
int getPort() const
|
||||
[[nodiscard]] int getPort() const
|
||||
{
|
||||
return portEdit->text().toInt();
|
||||
}
|
||||
QString getPlayerName() const
|
||||
[[nodiscard]] QString getPlayerName() const
|
||||
{
|
||||
return playernameEdit->text();
|
||||
}
|
||||
QString getToken() const
|
||||
[[nodiscard]] QString getToken() const
|
||||
{
|
||||
return tokenEdit->text();
|
||||
}
|
||||
QString getPassword() const
|
||||
[[nodiscard]] QString getPassword() const
|
||||
{
|
||||
return newpasswordEdit->text();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,31 +20,31 @@ class DlgRegister : public QDialog
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit DlgRegister(QWidget *parent = nullptr);
|
||||
QString getHost() const
|
||||
[[nodiscard]] QString getHost() const
|
||||
{
|
||||
return hostEdit->text();
|
||||
}
|
||||
int getPort() const
|
||||
[[nodiscard]] int getPort() const
|
||||
{
|
||||
return portEdit->text().toInt();
|
||||
}
|
||||
QString getPlayerName() const
|
||||
[[nodiscard]] QString getPlayerName() const
|
||||
{
|
||||
return playernameEdit->text();
|
||||
}
|
||||
QString getPassword() const
|
||||
[[nodiscard]] QString getPassword() const
|
||||
{
|
||||
return passwordEdit->text();
|
||||
}
|
||||
QString getEmail() const
|
||||
[[nodiscard]] QString getEmail() const
|
||||
{
|
||||
return emailEdit->text();
|
||||
}
|
||||
QString getCountry() const
|
||||
[[nodiscard]] QString getCountry() const
|
||||
{
|
||||
return countryEdit->currentIndex() == 0 ? "" : countryEdit->currentText();
|
||||
}
|
||||
QString getRealName() const
|
||||
[[nodiscard]] QString getRealName() const
|
||||
{
|
||||
return realnameEdit->text();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,19 +14,19 @@ class TipOfTheDay
|
|||
{
|
||||
public:
|
||||
explicit TipOfTheDay(QString _title, QString _content, QString _imagePath, QDate _date);
|
||||
QString getTitle() const
|
||||
[[nodiscard]] QString getTitle() const
|
||||
{
|
||||
return title;
|
||||
}
|
||||
QString getContent() const
|
||||
[[nodiscard]] QString getContent() const
|
||||
{
|
||||
return content;
|
||||
}
|
||||
QString getImagePath() const
|
||||
[[nodiscard]] QString getImagePath() const
|
||||
{
|
||||
return imagePath;
|
||||
}
|
||||
QDate getDate() const
|
||||
[[nodiscard]] QDate getDate() const
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
|
@ -51,8 +51,8 @@ public:
|
|||
explicit TipsOfTheDay(QString xmlPath, QObject *parent = nullptr);
|
||||
~TipsOfTheDay() override;
|
||||
TipOfTheDay getTip(int tipId);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
private:
|
||||
QList<TipOfTheDay> *tipList;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue