| 277 | } |
| 278 | |
| 279 | void InstanceList::deleteGroup(const GroupId& name) |
| 280 | { |
| 281 | m_groupNameCache.remove(name); |
| 282 | m_collapsedGroups.remove(name); |
| 283 | |
| 284 | bool removed = false; |
| 285 | qDebug() << "Delete group" << name; |
| 286 | for (auto& instance : m_instances) { |
| 287 | const QString& instID = instance->id(); |
| 288 | const QString instGroupName = getInstanceGroup(instID); |
| 289 | if (instGroupName == name) { |
| 290 | m_instanceGroupIndex.remove(instID); |
| 291 | qDebug() << "Remove" << instID << "from group" << name; |
| 292 | removed = true; |
| 293 | auto idx = getInstIndex(instance.get()); |
| 294 | if (idx >= 0) |
| 295 | emit dataChanged(index(idx), index(idx), { GroupRole }); |
| 296 | } |
| 297 | } |
| 298 | if (removed) |
| 299 | saveGroupList(); |
| 300 | } |
| 301 | |
| 302 | void InstanceList::renameGroup(const QString& src, const QString& dst) |
| 303 | { |