diff --git a/config.c b/config.c index 4ef6964..d60ccf6 100644 --- a/config.c +++ b/config.c @@ -7,7 +7,6 @@ cDesignerConfig::cDesignerConfig() { skinPathSet = false; logoPathSet = false; //Common - logoExtension = "png"; numLogosPerSizeInitial = 30; limitLogoCache = 1; numLogosMax = 200; diff --git a/config.h b/config.h index 7773208..85fba3b 100644 --- a/config.h +++ b/config.h @@ -43,7 +43,6 @@ public: void SetOSDFonts(void); bool OsdFontsChanged(void); cString GetSkinRessourcePath(void); - cString logoExtension; cString skinPath; cString logoPath; cString epgImagePath; diff --git a/libcore/imagecache.c b/libcore/imagecache.c index 62691e6..7eabbca 100644 --- a/libcore/imagecache.c +++ b/libcore/imagecache.c @@ -140,27 +140,18 @@ bool cImageCache::LogoExists(string channelID) { if (!channel) return false; string logoLower = StrToLowerCase(channel->Name()); - string logoExt = *config.logoExtension; - bool logoExists = FileExists(logoPath.c_str(), logoLower, logoExt); - if (logoExists) { - return true; - } - logoExists = FileExists(logoPath.c_str(), channelID, logoExt); - if (logoExists) { - return true; - } - return false; + + return (FileExists(logoPath.c_str(), logoLower, "svg") || + FileExists(logoPath.c_str(), logoLower, "png") || + FileExists(logoPath.c_str(), channelID, "svg") || + FileExists(logoPath.c_str(), channelID, "png")); } bool cImageCache::SeparatorLogoExists(string name) { string separatorPath = *cString::sprintf("%sseparatorlogos/", logoPath.c_str()); string nameLower = StrToLowerCase(name.c_str()); - string logoExt = *config.logoExtension; - bool logoExists = FileExists(separatorPath, nameLower, logoExt); - if (logoExists) { - return true; - } - return false; + + return FileExists(separatorPath, nameLower, "png"); } void cImageCache::CacheIcon(eImageType type, string name, int width, int height) { @@ -329,21 +320,23 @@ bool cImageCache::LoadLogo(const cChannel *channel) { return false; string channelID = StrToLowerCase(*(channel->GetChannelID().ToString())); string logoLower = StrToLowerCase(channel->Name()); - bool success = false; - if (FileExists(logoPath.c_str(), channelID.c_str(), *config.logoExtension)) - return LoadImage(logoPath.c_str(), channelID.c_str(), *config.logoExtension); - - if (FileExists(logoPath.c_str(), logoLower.c_str(), *config.logoExtension)) - return LoadImage(logoPath.c_str(), logoLower.c_str(), *config.logoExtension); + if (FileExists(logoPath.c_str(), channelID.c_str(), "svg")) + return LoadImage(logoPath.c_str(), channelID.c_str(), "svg"); + if (FileExists(logoPath.c_str(), channelID.c_str(), "png")) + return LoadImage(logoPath.c_str(), channelID.c_str(), "png"); + if (FileExists(logoPath.c_str(), logoLower.c_str(), "svg")) + return LoadImage(logoPath.c_str(), logoLower.c_str(), "svg"); + if (FileExists(logoPath.c_str(), logoLower.c_str(), "png")) + return LoadImage(logoPath.c_str(), logoLower.c_str(), "png"); return false; } bool cImageCache::LoadSeparatorLogo(string name) { - cString separatorPath = cString::sprintf("%sseparatorlogos/", logoPath.c_str()); + string separatorPath = *cString::sprintf("%sseparatorlogos/", logoPath.c_str()); string nameLower = StrToLowerCase(name.c_str()); - return LoadImage(*separatorPath, nameLower.c_str(), *config.logoExtension); + return LoadImage(separatorPath, nameLower.c_str(), "png"); } bool cImageCache::LoadSkinpart(string name) { diff --git a/libcore/imageloader.c b/libcore/imageloader.c index b752a99..1f4a31f 100644 --- a/libcore/imageloader.c +++ b/libcore/imageloader.c @@ -101,7 +101,6 @@ void cImageLoader::DeterminateChannelLogoSize(int &width, int &height) { else logoPath = config.logoPath; - cString logoExt = config.logoExtension; DIR *folder = NULL; struct dirent *file; folder = opendir(logoPath); @@ -109,7 +108,8 @@ void cImageLoader::DeterminateChannelLogoSize(int &width, int &height) { return; while ( (file = readdir(folder)) ) { - if (endswith(file->d_name, *logoExt)) { + if (endswith(file->d_name, ".png") || + endswith(file->d_name, ".svg")) { std::stringstream filePath; filePath << *logoPath << file->d_name; if (LoadImage(filePath.str().c_str())) {