| 284 | } |
| 285 | |
| 286 | void 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 | |
| 310 | static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr> &list) |
| 311 | { |
no test coverage detected