| 252 | } |
| 253 | |
| 254 | bool installIcon(QString root, QString instIconKey) |
| 255 | { |
| 256 | auto importIconPath = IconUtils::findBestIconIn(root, instIconKey); |
| 257 | if (importIconPath.isNull() || !QFile::exists(importIconPath)) |
| 258 | importIconPath = IconUtils::findBestIconIn(root, "icon.png"); |
| 259 | if (importIconPath.isNull() || !QFile::exists(importIconPath)) |
| 260 | importIconPath = IconUtils::findBestIconIn(FS::PathCombine(root, "overrides"), "icon.png"); |
| 261 | if (!importIconPath.isNull() && QFile::exists(importIconPath)) { |
| 262 | // import icon |
| 263 | auto iconList = APPLICATION->icons(); |
| 264 | if (iconList->iconFileExists(instIconKey)) { |
| 265 | iconList->deleteIcon(instIconKey); |
| 266 | } |
| 267 | iconList->installIcon(importIconPath, instIconKey + "." + QFileInfo(importIconPath).suffix()); |
| 268 | return true; |
| 269 | } |
| 270 | return false; |
| 271 | } |
| 272 | |
| 273 | void InstanceImportTask::processFlame() |
| 274 | { |
no test coverage detected