1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Moved most Menu::loadIcons() code into Link/LinkApp classes

The code still has a lot of overlap with the other methods of Link and
LinkApp, but at least it is in the same place now.

Since this was the last outside use, setIconPath() could be declared
as 'protected'.
This commit is contained in:
Maarten ter Huurne
2013-08-02 21:20:10 +02:00
parent 40372d14ef
commit a9b5d8bd19
5 changed files with 26 additions and 17 deletions

View File

@@ -261,6 +261,20 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
if (iconPath.empty()) searchIcon();
}
void LinkApp::loadIcon() {
if (icon.compare(0, 5, "skin:") == 0) {
string linkIcon = gmenu2x->sc.getSkinFilePath(
icon.substr(5, string::npos));
if (!fileExists(linkIcon))
searchIcon();
else
setIconPath(linkIcon);
} else if (!fileExists(icon)) {
searchIcon();
}
}
const string &LinkApp::searchIcon() {
if (!iconPath.empty())
return iconPath;