Fix group issues

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2023-10-30 09:26:38 +00:00
parent 3719ea21b0
commit 5a54d80c6e
No known key found for this signature in database
GPG Key ID: 5E39D70B4C93C38E
2 changed files with 7 additions and 6 deletions

View File

@ -290,8 +290,7 @@ void InstanceList::deleteGroup(const GroupId& name)
qDebug() << "Remove" << instID << "from group" << name;
removed = true;
auto idx = getInstIndex(instance.get());
if (idx > 0)
emit dataChanged(index(idx), index(idx), { GroupRole });
emit dataChanged(index(idx), index(idx), { GroupRole });
}
}
if (removed)
@ -315,8 +314,7 @@ void InstanceList::renameGroup(const QString& src, const QString& dst)
qDebug() << "Set" << instID << "group to" << dst;
modified = true;
auto idx = getInstIndex(instance.get());
if (idx > 0)
emit dataChanged(index(idx), index(idx), { GroupRole });
emit dataChanged(index(idx), index(idx), { GroupRole });
}
}
if (modified)
@ -947,9 +945,12 @@ QString InstanceList::getStagedInstancePath()
bool InstanceList::commitStagedInstance(const QString& path,
InstanceName const& instanceName,
const QString& groupName,
QString groupName,
InstanceTask const& commiting)
{
if (groupName.isEmpty() && !groupName.isNull())
groupName = QString();
QDir dir;
QString instID;
InstancePtr inst;

View File

@ -130,7 +130,7 @@ class InstanceList : public QAbstractListModel {
* should_override is used when another similar instance already exists, and we want to override it
* - for instance, when updating it.
*/
bool commitStagedInstance(const QString& keyPath, const InstanceName& instanceName, const QString& groupName, const InstanceTask&);
bool commitStagedInstance(const QString& keyPath, const InstanceName& instanceName, QString groupName, const InstanceTask&);
/**
* Destroy a previously created staging area given by @keyPath - used when creation fails.