From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/gui/widgets/desktop.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/gui/widgets/desktop.cpp') 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 -- cgit v1.2.3-70-g09d2