summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs/setup_relations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/tabs/setup_relations.cpp')
-rw-r--r--src/gui/widgets/tabs/setup_relations.cpp22
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);
}