| 443 | } |
| 444 | |
| 445 | QIcon IconList::getIcon(const QString &key) const |
| 446 | { |
| 447 | int icon_index = getIconIndex(key); |
| 448 | |
| 449 | if (icon_index != -1) |
| 450 | return icons[icon_index].icon(); |
| 451 | |
| 452 | // Fallback for icons that don't exist. |
| 453 | icon_index = getIconIndex("grass"); |
| 454 | |
| 455 | if (icon_index != -1) |
| 456 | return icons[icon_index].icon(); |
| 457 | return QIcon(); |
| 458 | } |
| 459 | |
| 460 | int IconList::getIconIndex(const QString &key) const |
| 461 | { |
no test coverage detected