From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/gui/windows/registerdialog.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gui/windows/registerdialog.cpp') 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() -- cgit v1.2.3-70-g09d2