| 292 | } |
| 293 | |
| 294 | void InstanceImportTask::processMultiMC() |
| 295 | { |
| 296 | QString configPath = FS::PathCombine(m_stagingPath, "instance.cfg"); |
| 297 | auto instanceSettings = std::make_shared<INISettingsObject>(configPath); |
| 298 | |
| 299 | NullInstance instance(m_globalSettings, instanceSettings, m_stagingPath); |
| 300 | |
| 301 | // reset time played on import... because packs. |
| 302 | instance.resetTimePlayed(); |
| 303 | |
| 304 | // set a new nice name |
| 305 | instance.setName(name()); |
| 306 | |
| 307 | // if the icon was specified by user, use that. otherwise pull icon from the pack |
| 308 | if (m_instIcon != "default") { |
| 309 | instance.setIconKey(m_instIcon); |
| 310 | } else { |
| 311 | m_instIcon = instance.iconKey(); |
| 312 | |
| 313 | auto importIconPath = IconUtils::findBestIconIn(instance.instanceRoot(), m_instIcon); |
| 314 | if (!importIconPath.isNull() && QFile::exists(importIconPath)) { |
| 315 | // import icon |
| 316 | auto iconList = APPLICATION->icons(); |
| 317 | if (iconList->iconFileExists(m_instIcon)) { |
| 318 | iconList->deleteIcon(m_instIcon); |
| 319 | } |
| 320 | iconList->installIcons({ importIconPath }); |
| 321 | } |
| 322 | } |
| 323 | emitSucceeded(); |
| 324 | } |
| 325 | |
| 326 | void InstanceImportTask::processModrinth() |
| 327 | { |
nothing calls this directly
no test coverage detected