MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / deleteInstance

Method deleteInstance

launcher/InstanceList.cpp:345–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void InstanceList::deleteInstance(const InstanceId& id)
346{
347 auto inst = getInstanceById(id);
348 if (!inst) {
349 qDebug() << "Cannot delete instance" << id << ". No such instance is present (deleted externally?).";
350 return;
351 }
352
353 if (m_instanceGroupIndex.remove(id)) {
354 saveGroupList();
355 }
356
357 qDebug() << "Will delete instance" << id;
358 if (!FS::deletePath(inst->instanceRoot())) {
359 qWarning() << "Deletion of instance" << id << "has not been completely successful ...";
360 return;
361 }
362
363 qDebug() << "Instance" << id << "has been deleted by the launcher.";
364}
365
366static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr>& list)
367{

Callers 1

Calls 3

deletePathFunction · 0.85
instanceRootMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected