SCRATCH things and stuff, related to grou saving
This commit is contained in:
@ -25,6 +25,7 @@
|
||||
#include "BaseInstance.h"
|
||||
|
||||
#include "FolderInstanceProvider.h"
|
||||
#include "FileSystem.h"
|
||||
|
||||
InstanceList::InstanceList(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
@ -118,6 +119,25 @@ void InstanceList::deleteGroup(const QString& name)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceList::deleteInstance(const InstanceId& id)
|
||||
{
|
||||
auto inst = getInstanceById(id);
|
||||
if(!inst)
|
||||
{
|
||||
qDebug() << "Cannot delete instance" << id << " No such instance is present.";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "Will delete instance" << id;
|
||||
if(!FS::deletePath(inst->instanceRoot()))
|
||||
{
|
||||
qWarning() << "Deletion of instance" << id << "has not been completely successful ...";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "Instance" << id << "has been deleted by MultiMC.";
|
||||
}
|
||||
|
||||
static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr> &list)
|
||||
{
|
||||
QMap<InstanceId, InstanceLocator> out;
|
||||
|
Reference in New Issue
Block a user