MCPcopy Create free account
hub / github.com/MultiMC/Launcher / deleteGroup

Method deleteGroup

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

Source from the content-addressed store, hash-verified

253}
254
255void 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
281bool InstanceList::isGroupCollapsed(const QString& group)
282{

Callers

nothing calls this directly

Calls 3

idMethod · 0.45
removeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected