summaryrefslogtreecommitdiff
path: root/src/gui/widgets/desktop.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/widgets/desktop.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/widgets/desktop.cpp')
-rw-r--r--src/gui/widgets/desktop.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index 83d5bd58e..43248ebe8 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -64,11 +64,11 @@ Desktop::Desktop(const Widget2 *const widget) :
Wallpaper::loadWallpapers();
- if (theme)
+ if (theme != nullptr)
mSkin = theme->load("desktop.xml", "");
- if (mSkin)
- mShowBackground = mSkin->getOption("showBackground");
+ if (mSkin != nullptr)
+ mShowBackground = (mSkin->getOption("showBackground") != 0);
const std::string appName = branding.getValue("appName", std::string());
if (appName.empty())
@@ -87,18 +87,18 @@ Desktop::Desktop(const Widget2 *const widget) :
Desktop::~Desktop()
{
- if (mWallpaper)
+ if (mWallpaper != nullptr)
{
mWallpaper->decRef();
mWallpaper = nullptr;
}
- if (theme)
+ if (theme != nullptr)
theme->unload(mSkin);
}
void Desktop::postInit()
{
- if (mSkin)
+ if (mSkin != nullptr)
{
addXY(mVersionLabel,
mSkin->getOption("versionX", 25),
@@ -130,7 +130,7 @@ void Desktop::draw(Graphics *const graphics)
const Rect &rect = mDimension;
const int width = rect.width;
const int height = rect.height;
- if (mWallpaper)
+ if (mWallpaper != nullptr)
{
const int wallpWidth = mWallpaper->getWidth();
const int wallpHeight = mWallpaper->getHeight();
@@ -178,9 +178,9 @@ void Desktop::setBestFittingWallpaper()
Image *const nWallPaper = Theme::getImageFromTheme(wallpaperName);
- if (nWallPaper)
+ if (nWallPaper != nullptr)
{
- if (mWallpaper)
+ if (mWallpaper != nullptr)
{
ResourceManager::decRefDelete(mWallpaper);
mWallpaper = nullptr;
@@ -198,7 +198,7 @@ void Desktop::setBestFittingWallpaper()
Image *const newRsclWlPpr = Loader::getRescaled(
nWallPaper, width, height);
- if (newRsclWlPpr)
+ if (newRsclWlPpr != nullptr)
{
ResourceManager::decRefDelete(nWallPaper);
// We replace the resource in the resource manager