From 7e4f69a5a736645b18e1433c2d5bdbebbc178bf9 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 27 Jan 2014 15:40:05 +0400 Subject: [PATCH] driver/framebuffer.cpp: try to load icons first from /var/tuxbox/icons/ Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1ee458e461cb7d27cd18d93e5271feb81cd10517 Author: [CST] Focus Date: 2014-01-27 (Mon, 27 Jan 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/framebuffer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 31f008a17..e01dbd85e 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -58,6 +58,7 @@ extern cVideo * videoDecoder; extern CPictureViewer * g_PicViewer; #define ICON_CACHE_SIZE 1024*1024*2 // 2mb +#define ICONDIR_VAR "/var/tuxbox/icons/" #define BACKGROUNDIMAGEWIDTH 720 @@ -953,7 +954,9 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in /* we cache and check original name */ it = icon_cache.find(filename); if(it == icon_cache.end()) { - std::string newname = iconBasePath + filename.c_str() + ".png"; + std::string newname = std::string(ICONDIR_VAR) + filename + ".png"; + if (access(newname.c_str(), F_OK)) + newname = iconBasePath + filename + ".png"; //printf("CFrameBuffer::paintIcon: check for %s\n", newname.c_str());fflush(stdout); data = g_PicViewer->getIcon(newname, &width, &height); @@ -972,7 +975,9 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in goto _display; } - newname = iconBasePath + filename.c_str() + ".raw"; + newname = std::string(ICONDIR_VAR) + filename + ".raw"; + if (access(newname.c_str(), F_OK)) + newname = iconBasePath + filename + ".raw"; int lfd = open(newname.c_str(), O_RDONLY);