MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / deleteGroup

Method deleteGroup

launcher/InstanceList.cpp:279–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void 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
302void InstanceList::renameGroup(const QString& src, const QString& dst)
303{

Callers

nothing calls this directly

Calls 3

removeMethod · 0.45
idMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected