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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user