diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/windows/registerdialog.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/windows/registerdialog.cpp')
-rw-r--r-- | src/gui/windows/registerdialog.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index c1940eb8d..699023d93 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -211,14 +211,15 @@ void RegisterDialog::action(const ActionEvent &event) errorMsg = _("Passwords do not match."); error = 2; } - else if (mEmailField && + else if ((mEmailField != nullptr) && mEmailField->getText().find('@') == std::string::npos) { // TRANSLATORS: error message errorMsg = _("Incorrect email."); error = 1; } - else if (mEmailField && mEmailField->getText().size() > 40) + else if (mEmailField != nullptr && + mEmailField->getText().size() > 40) { // TRANSLATORS: error message errorMsg = _("Email too long."); @@ -257,7 +258,7 @@ void RegisterDialog::action(const ActionEvent &event) mLoginData->password = mPasswordField->getText(); if (features.getIntValue("forceAccountGender") == -1) { - if (mFemaleButton && mFemaleButton->isSelected()) + if ((mFemaleButton != nullptr) && mFemaleButton->isSelected()) mLoginData->gender = Gender::FEMALE; else mLoginData->gender = Gender::MALE; @@ -268,7 +269,7 @@ void RegisterDialog::action(const ActionEvent &event) CAST_U8(features.getIntValue("forceAccountGender"))); } - if (mEmailField) + if (mEmailField != nullptr) mLoginData->email = mEmailField->getText(); mLoginData->registerLogin = true; @@ -306,7 +307,7 @@ bool RegisterDialog::canSubmit() const !mPasswordField->getText().empty() && !mConfirmField->getText().empty() && client->getState() == State::REGISTER && - (!mEmailField || !mEmailField->getText().empty()); + ((mEmailField == nullptr) || !mEmailField->getText().empty()); } void RegisterDialog::close() |