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/setupwindow.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/windows/setupwindow.cpp')
-rw-r--r-- | src/gui/windows/setupwindow.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 07ecc9ed7..bf5272d24 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -111,7 +111,9 @@ void SetupWindow::postInit() }; int x = width; mButtonPadding = getOption("buttonPadding", 5); - for (const char *const * curBtn = buttonNames; *curBtn; ++ curBtn) + for (const char *const * curBtn = buttonNames; + *curBtn != nullptr; + ++ curBtn) { Button *const btn = new Button(this, gettext(*curBtn), *curBtn, this); mButtons.push_back(btn); @@ -120,7 +122,7 @@ void SetupWindow::postInit() add(btn); // Store this button, as it needs to be enabled/disabled - if (!strcmp(*curBtn, "Reset Windows")) + if (strcmp(*curBtn, "Reset Windows") == 0) mResetWindows = btn; } @@ -148,7 +150,7 @@ void SetupWindow::postInit() } add(mPanel); - if (mResetWindows) + if (mResetWindows != nullptr) { mVersion->setPosition(9, height - mVersion->getHeight() - mResetWindows->getHeight() - 9); @@ -175,7 +177,7 @@ SetupWindow::~SetupWindow() void SetupWindow::action(const ActionEvent &event) { - if (Game::instance()) + if (Game::instance() != nullptr) Game::instance()->resetAdjustLevel(); const std::string &eventId = event.getId(); @@ -190,7 +192,7 @@ void SetupWindow::action(const ActionEvent &event) } else if (eventId == "Store") { - if (chatWindow) + if (chatWindow != nullptr) chatWindow->saveState(); config.write(); serverConfig.write(); @@ -199,12 +201,12 @@ void SetupWindow::action(const ActionEvent &event) { // Bail out if this action happens to be activated before the windows // are created (though it should be disabled then) - if (!statusWindow) + if (statusWindow == nullptr) return; FOR_EACH (std::list<Window*>::const_iterator, it, mWindowsToReset) { - if (*it) + if (*it != nullptr) (*it)->resetToDefaultSize(); } } @@ -212,7 +214,7 @@ void SetupWindow::action(const ActionEvent &event) void SetupWindow::setInGame(const bool inGame) { - if (mResetWindows) + if (mResetWindows != nullptr) mResetWindows->setEnabled(inGame); } @@ -227,14 +229,14 @@ void SetupWindow::externalUpdate() mPanel->addTab(mQuickTab->getName(), mQuickTab); FOR_EACH (std::list<SetupTab*>::const_iterator, it, mTabs) { - if (*it) + if (*it != nullptr) (*it)->externalUpdated(); } } void SetupWindow::unloadTab(SetupTab *const page) { - if (page) + if (page != nullptr) { mTabs.remove(page); mPanel->removeTab(mPanel->getTab(page->getName())); @@ -253,7 +255,7 @@ void SetupWindow::externalUnload() { FOR_EACH (std::list<SetupTab*>::const_iterator, it, mTabs) { - if (*it) + if (*it != nullptr) (*it)->externalUnloaded(); } unloadAdditionalTabs(); @@ -281,7 +283,7 @@ void SetupWindow::hideWindows() FOR_EACH (std::list<Window*>::const_iterator, it, mWindowsToReset) { Window *const window = *it; - if (window && !window->isSticky()) + if ((window != nullptr) && !window->isSticky()) window->setVisible(Visible_false); } setVisible(Visible_false); @@ -320,7 +322,7 @@ void SetupWindow::widgetResized(const Event &event) x -= btn->getWidth() + mButtonPadding; btn->setPosition(x, height - btn->getHeight() - mButtonPadding); } - if (mResetWindows) + if (mResetWindows != nullptr) { mVersion->setPosition(9, height - mVersion->getHeight() - mResetWindows->getHeight() - 9); |