From 2a3eecd99e9d7d8a138543ebdb892347f68aeaa2 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 25 Jan 2014 15:52:53 +0100 Subject: also check default paths when images and icons are loaded --- imagecache.c | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'imagecache.c') diff --git a/imagecache.c b/imagecache.c index 25d2662..eb3117c 100644 --- a/imagecache.c +++ b/imagecache.c @@ -548,14 +548,28 @@ void cImageCache::AddCornersGroupVertical(cImage *img) { bool cImageCache::LoadIcon(std::string name) { bool success = false; - cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPath, *tvguideConfig.themeName); - success = LoadImage(name, *iconPathTheme, "png"); - if (success) { - return true; - } else { - success = LoadImage(name, *tvguideConfig.iconPath, "png"); + if (tvguideConfig.iconsPathSet) { + cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPath, *tvguideConfig.themeName); + success = LoadImage(name, *iconPathTheme, "png"); if (success) { return true; + } else { + success = LoadImage(name, *tvguideConfig.iconPath, "png"); + if (success) { + return true; + } + } + } + if (!success) { + cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName); + success = LoadImage(name, *iconPathTheme, "png"); + if (success) { + return true; + } else { + success = LoadImage(name, *tvguideConfig.iconPathDefault, "png"); + if (success) { + return true; + } } } return false; @@ -573,10 +587,19 @@ bool cImageCache::LoadLogo(const cChannel *channel) { } else if (tvguideConfig.logoExtension == 1) { extension = "jpg"; } - success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension); + + if (tvguideConfig.logoPathSet) { + success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension); + if (success) + return true; + success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension); + if (success) + return true; + } + success = LoadImage(channelID.c_str(), *tvguideConfig.logoPathDefault, *extension); if (success) return true; - success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension); + success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPathDefault, *extension); return success; } -- cgit v1.2.3