From 988ba92051e39ac9a50acbb6d0acedbe7ed45aa3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 7 Oct 2013 17:19:27 +0200 Subject: [PATCH] pictureviewer: readd fallback to the std logo directory in flash Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/50ee98c3c9e99ca06306bd988ede86528dd23a5e Author: vanhofen Date: 2013-10-07 (Mon, 07 Oct 2013) Origin message was: ------------------ - pictureviewer: readd fallback to the std logo directory in flash --- src/driver/pictureviewer/pictureviewer.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index e3d188fef..d42b6f606 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -498,6 +498,8 @@ void CPictureViewer::getSize(const char* name, int* width, int *height) } } +#define LOGO_FLASH_DIR DATADIR "/neutrino/icons/logo" + bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& ChannelName, std::string & name, int *width, int *height) { std::string fileType[] = { ".png", ".jpg" , ".gif" }; @@ -511,16 +513,26 @@ bool CPictureViewer::GetLogoName(const uint64_t& channel_id, const std::string& std::vector v_path; std::string id_tmp_path; - //create filename with channel name + //create filename with channel name (logo_hdd_dir) id_tmp_path = g_settings.logo_hdd_dir + "/"; id_tmp_path += ChannelName + fileType[i]; v_path.push_back(id_tmp_path); - - //create filename with id + + //create filename with id (logo_hdd_dir) id_tmp_path = g_settings.logo_hdd_dir + "/"; id_tmp_path += strChnId + fileType[i]; v_path.push_back(id_tmp_path); + //create filename with channel name (LOGO_FLASH_DIR) + id_tmp_path = LOGO_FLASH_DIR "/"; + id_tmp_path += ChannelName + fileType[i]; + v_path.push_back(id_tmp_path); + + //create filename with id (LOGO_FLASH_DIR) + id_tmp_path = LOGO_FLASH_DIR "/"; + id_tmp_path += strChnId + fileType[i]; + v_path.push_back(id_tmp_path); + //check if file is available, name with real name is preferred, return true on success for (size_t j = 0; j < v_path.size(); j++){ if (access(v_path[j].c_str(), R_OK) != -1){