From 31dda9ab4d1559749a0f8f181ce1f7948e482813 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 19 Jan 2011 01:13:29 +0100 Subject: Fix the wallpapers loading broken logic. Trivial. --- src/resources/wallpaper.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 3301478e2..e27aa02c2 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -60,18 +60,22 @@ static void initDefaultWallpaperPaths() // Init the path wallpaperPath = branding.getStringValue("wallpapersPath"); - if (!wallpaperPath.empty() && resman->isDirectory(wallpaperPath)) - return; - else - wallpaperPath = paths.getValue("wallpapers", "graphics/images/"); + if (wallpaperPath.empty() || !resman->isDirectory(wallpaperPath)) + wallpaperPath = paths.getValue("wallpapers", ""); + + if (wallpaperPath.empty() || !resman->isDirectory(wallpaperPath)) + wallpaperPath = "graphics/images/"; // Init the default file wallpaperFile = branding.getStringValue("wallpaperFile"); - if (!wallpaperFile.empty()) + if (!wallpaperFile.empty() && !resman->isDirectory(wallpaperFile)) return; else - wallpaperFile = paths.getValue("wallpaperFile", "login_wallpaper.png"); + wallpaperFile = paths.getValue("wallpaperFile", ""); + + if (wallpaperFile.empty() || resman->isDirectory(wallpaperFile)) + wallpaperFile = "login_wallpaper.png"; } bool wallpaperCompare(WallpaperData a, WallpaperData b) -- cgit v1.2.3-70-g09d2