MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / deleteGroup

Method deleteGroup

launcher/InstanceList.cpp:263–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void 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
285bool InstanceList::isGroupCollapsed(const QString& group)
286{

Callers

nothing calls this directly

Calls 3

idMethod · 0.45
removeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected