diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-01-19 01:13:29 +0100 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-01-19 02:26:04 +0200 |
commit | 31dda9ab4d1559749a0f8f181ce1f7948e482813 (patch) | |
tree | c996f3e8db173ffafeb1d03429aa7b3d267483b9 /src | |
parent | 7832854bdce2d1cd53f05e224419820cac7e7bf2 (diff) | |
download | manaplus-31dda9ab4d1559749a0f8f181ce1f7948e482813.tar.gz manaplus-31dda9ab4d1559749a0f8f181ce1f7948e482813.tar.bz2 manaplus-31dda9ab4d1559749a0f8f181ce1f7948e482813.tar.xz manaplus-31dda9ab4d1559749a0f8f181ce1f7948e482813.zip |
Fix the wallpapers loading broken logic.
Trivial.
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/wallpaper.cpp | 16 |
1 files 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) |