Add Default Constructors to users and groups, and change Users to

Members in the Group class.
This commit is contained in:
Luke De Mouy
2016-01-13 20:38:42 -07:00
parent b099e477ee
commit 66c878697c
2 changed files with 19 additions and 2 deletions

View File

@@ -327,7 +327,7 @@ void UserManager::loadGroups()
group.Name = line.section(":",0,0);
group.ID = line.section(":",2,2).toInt();
QString memberString = line.section(":",3,3);
group.Users = memberString.split(",");
group.Members = memberString.split(",");
groups.append(group);
}

View File

@@ -13,6 +13,16 @@ namespace sysadm{
class User
{
public:
User()
{
FullName = "";
UserName = "";
ID = -1;
HomeFolder = "";
Shell = "";
GroupID = -1;
}
QString FullName;
QString UserName;
int ID;
@@ -34,13 +44,20 @@ public:
class Group
{
public:
Group()
{
ID = -1;
Name = "";
Members = QStringList();
}
int ID;
QString Name;
//While the object model would be more "correct" if
//Users were to be a Vector of User pointers, it's
//expensive to wire up and we don't really gain anything
//from doing so
QStringList Users;
QStringList Members;
};
class UserManager