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