summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-19 01:13:29 +0100
committerAndrei Karas <akaras@inbox.ru>2011-01-19 02:26:04 +0200
commit31dda9ab4d1559749a0f8f181ce1f7948e482813 (patch)
treec996f3e8db173ffafeb1d03429aa7b3d267483b9
parent7832854bdce2d1cd53f05e224419820cac7e7bf2 (diff)
downloadmanaverse-31dda9ab4d1559749a0f8f181ce1f7948e482813.tar.gz
manaverse-31dda9ab4d1559749a0f8f181ce1f7948e482813.tar.bz2
manaverse-31dda9ab4d1559749a0f8f181ce1f7948e482813.tar.xz
manaverse-31dda9ab4d1559749a0f8f181ce1f7948e482813.zip
Fix the wallpapers loading broken logic.
Trivial.
-rw-r--r--src/resources/wallpaper.cpp16
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)