mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
supplemental 2 to 04a8e71a22
Origin commit data
------------------
Branch: ni/coolstream
Commit: 26e1bbc426
Author: TangoCash <eric@loxat.de>
Date: 2021-10-29 (Fri, 29 Oct 2021)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -698,15 +698,19 @@ void CFrameBuffer::setIconBasePath(const std::string & iconPath)
|
||||
|
||||
std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_type)
|
||||
{
|
||||
// why search when we have an absolut path ?
|
||||
if (icon_name.find("/", 0) != std::string::npos)
|
||||
return icon_name;
|
||||
|
||||
std::vector<std::string> filetypes = { ".svg", ".png", ".jpg" };
|
||||
std::string path, filetype = "";
|
||||
std::string path = icon_name;
|
||||
|
||||
std::string::size_type pos = icon_name.find_last_of(".");
|
||||
if (pos != std::string::npos && file_type.empty())
|
||||
if (std::find(filetypes.begin(), filetypes.end(), icon_name.substr(pos)) != filetypes.end())
|
||||
{
|
||||
icon_name = icon_name.substr(0,pos);
|
||||
file_type = icon_name.substr(pos+1);
|
||||
icon_name = path.substr(0,pos);
|
||||
file_type = path.substr(pos+1);
|
||||
}
|
||||
if (!file_type.empty())
|
||||
{
|
||||
@@ -734,10 +738,8 @@ std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_ty
|
||||
}
|
||||
}
|
||||
|
||||
if (icon_name.find("/", 0) != std::string::npos)
|
||||
path = icon_name;
|
||||
|
||||
return path;
|
||||
// nothing found, return empty string
|
||||
return "";
|
||||
}
|
||||
|
||||
void CFrameBuffer::getIconSize(const char * const filename, int* width, int *height)
|
||||
|
Reference in New Issue
Block a user