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: bc794bab56
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-04-11 (Wed, 11 Apr 2018)
This commit is contained in:
2018-04-11 23:58:15 +02:00
committed by vanhofen
parent 7b21adb9dd
commit 90bf89e1ff

View File

@@ -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;
}