mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 10:20:26 +00:00
Add Default Constructors to users and groups, and change Users to
Members in the Group class.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user