MCPcopy Create free account
hub / github.com/MultiMC/Launcher / deleteInstance

Method deleteInstance

launcher/InstanceList.cpp:286–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286void InstanceList::deleteInstance(const InstanceId& id)
287{
288 auto inst = getInstanceById(id);
289 if(!inst)
290 {
291 qDebug() << "Cannot delete instance" << id << ". No such instance is present (deleted externally?).";
292 return;
293 }
294
295 if(m_instanceGroupIndex.remove(id))
296 {
297 saveGroupList();
298 }
299
300 qDebug() << "Will delete instance" << id;
301 if(!FS::deletePath(inst->instanceRoot()))
302 {
303 qWarning() << "Deletion of instance" << id << "has not been completely successful ...";
304 return;
305 }
306
307 qDebug() << "Instance" << id << "has been deleted by the launcher.";
308}
309
310static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr> &list)
311{

Callers 1

Calls 3

deletePathFunction · 0.85
instanceRootMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected