mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Mark more functions as [[nodiscard]] (#6320)
* Fix local variable double declaration. Took 44 seconds * Mark functions as [[nodiscard]] Took 31 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
27708d5964
commit
73763b5ee6
65 changed files with 258 additions and 257 deletions
|
|
@ -34,16 +34,16 @@ signals:
|
|||
public:
|
||||
explicit DlgConnect(QWidget *parent = nullptr);
|
||||
~DlgConnect() override;
|
||||
QString getHost() const;
|
||||
int getPort() const
|
||||
[[nodiscard]] QString getHost() 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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,15 +23,15 @@ public:
|
|||
QString email = QString(),
|
||||
QString country = QString(),
|
||||
QString realName = QString());
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,19 +20,19 @@ class DlgForgotPasswordChallenge : public QDialog
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit DlgForgotPasswordChallenge(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 getEmail() const
|
||||
[[nodiscard]] QString getEmail() const
|
||||
{
|
||||
return emailEdit->text();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public:
|
|||
* to use it, since otherwise it will get destroyed once this dlg is destroyed
|
||||
* @return The DeckLoader
|
||||
*/
|
||||
virtual DeckLoader *getDeckList() const = 0;
|
||||
[[nodiscard]] virtual DeckLoader *getDeckList() const = 0;
|
||||
|
||||
protected:
|
||||
void setText(const QString &text);
|
||||
|
|
@ -67,7 +67,7 @@ private:
|
|||
public:
|
||||
explicit DlgLoadDeckFromClipboard(QWidget *parent = nullptr);
|
||||
|
||||
DeckLoader *getDeckList() const override
|
||||
[[nodiscard]] DeckLoader *getDeckList() const override
|
||||
{
|
||||
return deckList;
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ private:
|
|||
public:
|
||||
explicit DlgEditDeckInClipboard(const DeckLoader &deckList, bool _annotated, QWidget *parent = nullptr);
|
||||
|
||||
DeckLoader *getDeckList() const override
|
||||
[[nodiscard]] DeckLoader *getDeckList() const override
|
||||
{
|
||||
return deckLoader;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ private slots:
|
|||
|
||||
public:
|
||||
explicit DlgLoadRemoteDeck(AbstractClient *_client, QWidget *parent = nullptr);
|
||||
int getDeckId() const;
|
||||
[[nodiscard]] int getDeckId() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
QStringList getAllCardsForSet();
|
||||
void populateCardList();
|
||||
void updateCardDisplayWidgets();
|
||||
bool isChecked() const;
|
||||
[[nodiscard]] bool isChecked() const;
|
||||
DlgSelectSetForCards *parent;
|
||||
QString setName;
|
||||
bool expanded;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue