MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / installIcon

Function installIcon

launcher/InstanceImportTask.cpp:254–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254bool 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
273void InstanceImportTask::processFlame()
274{

Callers 4

processFlameMethod · 0.85
processMultiMCMethod · 0.85
processModrinthMethod · 0.85
installIconsMethod · 0.85

Calls 7

findBestIconInFunction · 0.85
PathCombineFunction · 0.85
QFileInfoClass · 0.85
iconsMethod · 0.80
iconFileExistsMethod · 0.80
deleteIconMethod · 0.80
installIconMethod · 0.80

Tested by

no test coverage detected