infoicons: simplify icon detection

Origin commit data
------------------
Commit: e8c31e5fda
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-12-13 (Tue, 13 Dec 2016)

Origin message was:
------------------
- infoicons: simplify icon detection
This commit is contained in:
vanhofen
2016-12-13 11:19:12 +01:00
parent 5cf92f6628
commit e36ec06294

View File

@@ -112,14 +112,10 @@ void CInfoIcons::Init()
{
int icon_sizeW = 0;
int icon_sizeH = 0;
buf.str("");
buf << ICONSDIR << "/" << icon[i].name << "_on.png";
// we assume the _off-partner exist and has same dimensions
if (access(buf.str().c_str(), F_OK) == 0) {
buf.str("");
buf << icon[i].name << "_on";
frameBuffer->getIconSize(buf.str().c_str(), &icon_sizeW, &icon_sizeH);
}
buf.str("");
buf << icon[i].name << "_on";
frameBuffer->getIconSize(buf.str().c_str(), &icon_sizeW, &icon_sizeH);
if (icon_sizeW && icon_sizeH)
{