From 90bf89e1ffddc8e79db7b5ac52aeded5bf84de2e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 11 Apr 2018 23:58:15 +0200 Subject: [PATCH] CFrameBuffer: add more possible icon paths in order of priority This gives possibility to use theme relevant icon sets. scheme: /path/to/theme/icons/file.png example: /usr/share/tuxbox/neutrino/themes/Neutrino-3.0/icons/file.png Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bc794bab565b4367952cf089d6536235adcf1c6d Author: Thilo Graf Date: 2018-04-11 (Wed, 11 Apr 2018) --- src/driver/fb_generic.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 499fa2799..667d67143 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -698,11 +698,23 @@ std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_ty { std::string path, filetype; filetype = "." + file_type; - path = std::string(ICONSDIR_VAR) + "/" + icon_name + filetype; - if (access(path.c_str(), F_OK)) - path = iconBasePath + "/" + icon_name + filetype; + + std::string dir[] = { THEMESDIR_VAR "/" + g_settings.theme_name + "/icons", + THEMESDIR "/" + g_settings.theme_name + "/icons", + ICONSDIR_VAR, + iconBasePath + }; + + for(int i=0; i<4 ; i++){ + path = std::string(dir[i]) + "/" + icon_name + filetype; + if (access(path.c_str(), F_OK) == 0){ + return path; + } + } + if (icon_name.find("/", 0) != std::string::npos) path = icon_name; + return path; }