summaryrefslogtreecommitdiff
path: root/src/gui/popups/itempopup.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/popups/itempopup.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmv-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/popups/itempopup.cpp')
-rw-r--r--src/gui/popups/itempopup.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp
index 17f955da0..3fc546cf0 100644
--- a/src/gui/popups/itempopup.cpp
+++ b/src/gui/popups/itempopup.cpp
@@ -125,10 +125,10 @@ void ItemPopup::postInit()
ItemPopup::~ItemPopup()
{
- if (mIcon)
+ if (mIcon != nullptr)
{
Image *const image = mIcon->getImage();
- if (image)
+ if (image != nullptr)
image->decRef();
}
}
@@ -136,7 +136,7 @@ ItemPopup::~ItemPopup()
void ItemPopup::setItem(const Item *const item,
const bool showImage)
{
- if (!item)
+ if (item == nullptr)
return;
const ItemInfo &ii = item->getInfo();
@@ -181,8 +181,8 @@ void ItemPopup::setItem(const ItemInfo &item,
const int *const cards,
const ItemOptionsList *const options)
{
- if (!mIcon || (item.getName() == mLastName && color == mLastColor
- && id == mLastId))
+ if (mIcon == nullptr ||
+ (item.getName() == mLastName && color == mLastColor && id == mLastId))
{
return;
}
@@ -193,7 +193,7 @@ void ItemPopup::setItem(const ItemInfo &item,
int space = 0;
Image *const oldImage = mIcon->getImage();
- if (oldImage)
+ if (oldImage != nullptr)
oldImage->decRef();
if (showImage)
@@ -204,7 +204,7 @@ void ItemPopup::setItem(const ItemInfo &item,
item.getDyeIconColorsString(color)));
mIcon->setImage(image);
- if (image)
+ if (image != nullptr)
{
mIcon->setPosition(0, 0);
space = mIcon->getWidth();
@@ -297,7 +297,7 @@ void ItemPopup::setItem(const ItemInfo &item,
std::string ItemPopup::getCardsString(const int *const cards)
{
- if (!cards)
+ if (cards == nullptr)
return std::string();
std::string label;
@@ -331,7 +331,7 @@ std::string ItemPopup::getCardsString(const int *const cards)
for (int f = 0; f < maxCards; f ++)
{
const int id = cards[f];
- if (id)
+ if (id != 0)
{
if (!label.empty())
label.append(" / ");