mirror of https://github.com/qTox/qTox.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
615 B
31 lines
615 B
#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; |
|
} |
|
} |
|
}
|
|
|