MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / deleteInstance

Method deleteInstance

launcher/InstanceList.cpp:390–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void 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
414static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr>& list)
415{

Callers 1

Calls 3

deletePathFunction · 0.85
instanceRootMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected