1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/grouplist.cpp
Tux3 / Mlkj / !Lev.uXFMLA 18cee41cfb Initial commit
2014-06-24 22:11:11 +02:00

32 lines
615 B
C++

#include "grouplist.h"
#include "group.h"
QList<Group*> GroupList::groupList;
Group* GroupList::addGroup(int groupId, QString name)
{
Group* newGroup = new Group(groupId, name);
groupList.append(newGroup);
return newGroup;
}
Group* GroupList::findGroup(int groupId)
{
for (Group* g : groupList)
if (g->groupId == groupId)
return g;
return nullptr;
}
void GroupList::removeGroup(int groupId)
{
for (int i=0; i<groupList.size(); i++)
{
if (groupList[i]->groupId == groupId)
{
groupList.removeAt(i);
return;
}
}
}