1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 01:20:37 +02:00

Load the skin's wallpaper if the default one is not yet defined

This commit is contained in:
Paul Cercueil 2012-12-04 14:21:22 -03:00
parent 37a29d30d1
commit 389253b4c6

View File

@ -277,7 +277,7 @@ GMenu2X::GMenu2X()
bg = NULL; bg = NULL;
font = NULL; font = NULL;
menu = NULL; menu = NULL;
setSkin(confStr["skin"], false); setSkin(confStr["skin"], !fileExists(confStr["wallpaper"]));
initMenu(); initMenu();
if (!fileExists(confStr["wallpaper"])) { if (!fileExists(confStr["wallpaper"])) {
@ -976,8 +976,13 @@ void GMenu2X::setSkin(const string &skin, bool setWallpaper) {
} }
skinconf.close(); skinconf.close();
if (setWallpaper && !skinConfStr["wallpaper"].empty() && fileExists("skins/"+skin+"/wallpapers/"+skinConfStr["wallpaper"])) if (setWallpaper && !skinConfStr["wallpaper"].empty()) {
confStr["wallpaper"] = "skins/"+skin+"/wallpapers/"+skinConfStr["wallpaper"]; string fp = sc.getSkinFilePath("wallpapers/" + skinConfStr["wallpaper"]);
if (!fp.empty())
confStr["wallpaper"] = fp;
else
WARNING("Unable to find wallpaper defined on skin %s\n", skin.c_str());
}
} }
} }