diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 32192f8cd..be5cf4b3e 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -698,20 +698,31 @@ void CFrameBuffer::setIconBasePath(const std::string & iconPath) std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_type) { + std::vector filetypes = { ".svg", ".png", ".jpg" }; std::string path, filetype = ""; if (!file_type.empty()) - filetype = "." + file_type; + { + filetypes.clear(); + filetypes.push_back("." + file_type); + } - std::string dir[] = { THEMESDIR_VAR "/" + g_settings.theme_name + "/icons", - THEMESDIR "/" + g_settings.theme_name + "/icons", - ICONSDIR_VAR, - iconBasePath + std::vector 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; + for(int t=0; tgetIcon(newname, &width, &height);