From ae9be1be319c90a1131fad1a9a486fc0afe798ee Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 11 Apr 2018 16:12:03 +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 --- 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 8fb9b1207..05037341b 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -706,11 +706,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; }