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:
16
src/menu.cpp
16
src/menu.cpp
@@ -122,21 +122,7 @@ void Menu::loadIcons() {
|
||||
gmenu2x->sc.add("skin:" + sectionIcon);
|
||||
|
||||
for (Link *&link : links[i]) {
|
||||
LinkApp *linkapp = dynamic_cast<LinkApp*>(link);
|
||||
|
||||
//check link's icons
|
||||
string linkIcon = link->getIcon();
|
||||
if (linkIcon.substr(0,5) == "skin:") {
|
||||
linkIcon = gmenu2x->sc.getSkinFilePath(
|
||||
linkIcon.substr(5, linkIcon.length()));
|
||||
if (linkapp != NULL && !fileExists(linkIcon))
|
||||
linkapp->searchIcon();
|
||||
else
|
||||
link->setIconPath(linkIcon);
|
||||
|
||||
} else if (!fileExists(linkIcon)) {
|
||||
if (linkapp != NULL) linkapp->searchIcon();
|
||||
}
|
||||
link->loadIcon();
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user