| 261 | } |
| 262 | |
| 263 | void InstanceList::deleteGroup(const QString& name) |
| 264 | { |
| 265 | bool removed = false; |
| 266 | qDebug() << "Delete group" << name; |
| 267 | for (auto& instance : m_instances) { |
| 268 | const auto& instID = instance->id(); |
| 269 | auto instGroupName = getInstanceGroup(instID); |
| 270 | if (instGroupName == name) { |
| 271 | m_instanceGroupIndex.remove(instID); |
| 272 | qDebug() << "Remove" << instID << "from group" << name; |
| 273 | removed = true; |
| 274 | auto idx = getInstIndex(instance.get()); |
| 275 | if (idx > 0) { |
| 276 | emit dataChanged(index(idx), index(idx), { GroupRole }); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | if (removed) { |
| 281 | saveGroupList(); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | bool InstanceList::isGroupCollapsed(const QString& group) |
| 286 | { |