summaryrefslogtreecommitdiff
path: root/src/gui/widgets/desktop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/desktop.cpp')
-rw-r--r--src/gui/widgets/desktop.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index 474aadb0..ca86360e 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -52,11 +52,7 @@ Desktop::Desktop()
add(mVersionLabel, 25, 2);
}
-Desktop::~Desktop()
-{
- if (mWallpaper)
- mWallpaper->decRef();
-}
+Desktop::~Desktop() = default;
void Desktop::reloadWallpaper()
{
@@ -109,14 +105,11 @@ void Desktop::setBestFittingWallpaper()
return;
ResourceManager *resman = ResourceManager::getInstance();
- Image *wallpaper = resman->getImage(wallpaperName);
+ auto wallpaper = resman->getImageRef(wallpaperName);
if (wallpaper)
{
- if (mWallpaper)
- mWallpaper->decRef(Resource::DeleteImmediately);
-
- mWallpaper = wallpaper;
+ mWallpaper = std::move(wallpaper);
}
else
{