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/mailwindow.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/mailwindow.cpp')
-rw-r--r-- | src/gui/windows/mailwindow.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 96df275e6..98570340f 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -78,7 +78,7 @@ MailWindow::MailWindow() : setSaveVisible(true); setStickyButtonLock(true); - if (setupWindow) + if (setupWindow != nullptr) setupWindow->registerWindowForReset(this); setDefaultSize(310, 180, ImagePosition::CENTER); @@ -122,7 +122,7 @@ void MailWindow::action(const ActionEvent &event) } else if (eventId == "new") { - if (!mailEditWindow) + if (mailEditWindow == nullptr) { CREATEWIDGETV0(mailEditWindow, MailEditWindow); } @@ -164,7 +164,7 @@ void MailWindow::clear() void MailWindow::addMail(MailMessage *const message) { - if (!message) + if (message == nullptr) return; mMessages.push_back(message); mMailModel->add(strprintf("%s %s", @@ -184,7 +184,7 @@ void MailWindow::removeMail(const int id) FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; - if (message && message->id == id) + if ((message != nullptr) && message->id == id) { mMessages.erase(it); delete message; @@ -195,7 +195,7 @@ void MailWindow::removeMail(const int id) FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; - if (message) + if (message != nullptr) { mMailModel->add(strprintf("%s %s", message->unread ? " " : "U", @@ -206,7 +206,7 @@ void MailWindow::removeMail(const int id) void MailWindow::showMessage(MailMessage *const mail) { - if (!mail) + if (mail == nullptr) return; const std::map<int, MailMessage*>::const_iterator it = mMessagesMap.find(mail->id); @@ -225,7 +225,7 @@ void MailWindow::viewNext(const int id) FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; - if (message && message->id == id) + if ((message != nullptr) && message->id == id) { ++ it; if (it == mMessages.end()) @@ -249,7 +249,7 @@ void MailWindow::viewPrev(const int id) FOR_EACH (std::vector<MailMessage*>::iterator, it, mMessages) { MailMessage *message = *it; - if (message && message->id == id) + if ((message != nullptr) && message->id == id) { if (it == mMessages.begin()) { @@ -288,7 +288,7 @@ void MailWindow::postConnection() void MailWindow::createMail(const std::string &to) { - if (mailEditWindow) + if (mailEditWindow != nullptr) return; CREATEWIDGETV0(mailEditWindow, MailEditWindow); |