| 388 | } |
| 389 | |
| 390 | void InstanceList::deleteInstance(const InstanceId& id) |
| 391 | { |
| 392 | auto inst = getInstanceById(id); |
| 393 | if (!inst) { |
| 394 | qDebug() << "Cannot delete instance" << id << ". No such instance is present (deleted externally?)."; |
| 395 | return; |
| 396 | } |
| 397 | |
| 398 | QString cachedGroupId = m_instanceGroupIndex[id]; |
| 399 | |
| 400 | if (m_instanceGroupIndex.remove(id)) { |
| 401 | decreaseGroupCount(cachedGroupId); |
| 402 | saveGroupList(); |
| 403 | } |
| 404 | |
| 405 | qDebug() << "Will delete instance" << id; |
| 406 | if (!FS::deletePath(inst->instanceRoot())) { |
| 407 | qWarning() << "Deletion of instance" << id << "has not been completely successful ..."; |
| 408 | return; |
| 409 | } |
| 410 | |
| 411 | qDebug() << "Instance" << id << "has been deleted by the launcher."; |
| 412 | } |
| 413 | |
| 414 | static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr>& list) |
| 415 | { |
no test coverage detected