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/widgets/tabs/setup_relations.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/widgets/tabs/setup_relations.cpp')
-rw-r--r-- | src/gui/widgets/tabs/setup_relations.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index 0054da32b..d81bca9a9 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -70,10 +70,10 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : mPlayerScrollArea(new ScrollArea(this, mPlayerTable)), // TRANSLATORS: relation dialog button mDefaultTrading(new CheckBox(this, _("Allow trading"), - player_relations.getDefault() & PlayerRelation::TRADE)), + (player_relations.getDefault() & PlayerRelation::TRADE) != 0u)), // TRANSLATORS: relation dialog button mDefaultWhisper(new CheckBox(this, _("Allow whispers"), - player_relations.getDefault() & PlayerRelation::WHISPER)), + (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u)), // TRANSLATORS: relation dialog button mDeleteButton(new Button(this, _("Delete"), ACTION_DELETE, this)), mIgnoreActionChoicesModel(new IgnoreChoicesListModel), @@ -112,7 +112,7 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : int ignore_strategy_index = 0; // safe default - if (player_relations.getPlayerIgnoreStrategy()) + if (player_relations.getPlayerIgnoreStrategy() != nullptr) { ignore_strategy_index = player_relations.getPlayerIgnoreStrategyIndex( player_relations.getPlayerIgnoreStrategy()->mShortName); @@ -177,10 +177,10 @@ void Setup_Relations::apply() | (mDefaultTrading->isSelected() ? PlayerRelation::TRADE : 0) | (mDefaultWhisper->isSelected() ? PlayerRelation::WHISPER : 0)); - if (actorManager) + if (actorManager != nullptr) actorManager->updatePlayerNames(); - if (localPlayer) + if (localPlayer != nullptr) localPlayer->setCheckNameSetting(true); } @@ -231,10 +231,10 @@ void Setup_Relations::updatedPlayer(const std::string &name A_UNUSED) { mPlayerTableModel->playerRelationsUpdated(); mDefaultTrading->setSelected( - player_relations.getDefault() & PlayerRelation::TRADE); + (player_relations.getDefault() & PlayerRelation::TRADE) != 0u); mDefaultWhisper->setSelected( - player_relations.getDefault() & PlayerRelation::WHISPER); - if (localPlayer) + (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u); + if (localPlayer != nullptr) localPlayer->updateName(); } @@ -246,7 +246,7 @@ void Setup_Relations::updateAll() mPlayerTableModel = model; int ignore_strategy_index = 0; // safe default - if (player_relations.getPlayerIgnoreStrategy()) + if (player_relations.getPlayerIgnoreStrategy() != nullptr) { ignore_strategy_index = player_relations.getPlayerIgnoreStrategyIndex( player_relations.getPlayerIgnoreStrategy()->mShortName); @@ -260,7 +260,7 @@ void Setup_Relations::updateAll() void Setup_Relations::externalUpdated() { mDefaultTrading->setSelected( - player_relations.getDefault() & PlayerRelation::TRADE); + (player_relations.getDefault() & PlayerRelation::TRADE) != 0u); mDefaultWhisper->setSelected( - player_relations.getDefault() & PlayerRelation::WHISPER); + (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u); } |