summaryrefslogtreecommitdiff
path: root/src/resources/wallpaper.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-19 01:13:29 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-27 19:24:51 +0100
commit5836fb4abac52c53dbdc51d15e030b14eb46fb40 (patch)
tree009ae1974c057ec085770d01c2fcd8161a575ad9 /src/resources/wallpaper.cpp
parent40c58b4fe1fe73563f57830b7e57b3cbca9c972a (diff)
downloadmana-5836fb4abac52c53dbdc51d15e030b14eb46fb40.tar.gz
mana-5836fb4abac52c53dbdc51d15e030b14eb46fb40.tar.bz2
mana-5836fb4abac52c53dbdc51d15e030b14eb46fb40.tar.xz
mana-5836fb4abac52c53dbdc51d15e030b14eb46fb40.zip
Fix the wallpapers loading broken logic.
Trivial.
Diffstat (limited to 'src/resources/wallpaper.cpp')
-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 06675ab1..0fd1c291 100644
--- a/src/resources/wallpaper.cpp
+++ b/src/resources/wallpaper.cpp
@@ -55,18 +55,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.getStringValue("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.getStringValue("wallpaperFile");
+
+ if (wallpaperFile.empty() || resman->isDirectory(wallpaperFile))
+ wallpaperFile = "login_wallpaper.png";
}
bool wallpaperCompare(WallpaperData a, WallpaperData b)