diff options
author | louis <louis.braun@gmx.de> | 2014-01-25 15:52:53 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-01-25 15:52:53 +0100 |
commit | 2a3eecd99e9d7d8a138543ebdb892347f68aeaa2 (patch) | |
tree | 446c81af4061046903e329fcf704c2eb7bf32252 /imagecache.c | |
parent | 0cbc226651dbce5c01167ba24edc1d417634fb39 (diff) | |
download | vdr-plugin-tvguide-2a3eecd99e9d7d8a138543ebdb892347f68aeaa2.tar.gz vdr-plugin-tvguide-2a3eecd99e9d7d8a138543ebdb892347f68aeaa2.tar.bz2 |
also check default paths when images and icons are loaded
Diffstat (limited to 'imagecache.c')
-rw-r--r-- | imagecache.c | 39 |
1 files changed, 31 insertions, 8 deletions
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;
}
|