summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/opie-usermanager.control2
-rw-r--r--noncore/settings/usermanager/passwd.cpp11
-rw-r--r--noncore/settings/usermanager/userdialog.cpp6
-rw-r--r--noncore/settings/usermanager/usermanager.cpp26
4 files changed, 28 insertions, 17 deletions
diff --git a/noncore/settings/usermanager/opie-usermanager.control b/noncore/settings/usermanager/opie-usermanager.control
index f971fdc..e1c7762 100644
--- a/noncore/settings/usermanager/opie-usermanager.control
+++ b/noncore/settings/usermanager/opie-usermanager.control
@@ -8,2 +8,2 @@ Maintainer: Ted Parnefors <zaurus@bredband.net>
8License: GPL 8License: GPL
9Description: User/Group manager for OPIE. 9Description: User/Group manager for Opie.
diff --git a/noncore/settings/usermanager/passwd.cpp b/noncore/settings/usermanager/passwd.cpp
index 1e98778..f8e6d17 100644
--- a/noncore/settings/usermanager/passwd.cpp
+++ b/noncore/settings/usermanager/passwd.cpp
@@ -209,6 +209,11 @@ bool Passwd::searchGroup(QRegExp &groupRegExp) {
209 } else { 209 } else {
210 groupString=(*(tempStringList.begin())); 210 for(QStringList::Iterator it=tempStringList.begin(); it!=tempStringList.end(); it++) {
211 splitGroupEntry(groupString); 211 groupString=*it;
212 if(!groupString.find(QRegExp("^#"),0)) {// Skip commented lines.
213 splitGroupEntry(groupString);
214 return true;
215 }
216 }
212 } 217 }
213 return true; 218 return false;
214} 219}
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 0d2122b..c06f639 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -46,4 +46,6 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
46 accounts->splitGroupEntry(*it); 46 accounts->splitGroupEntry(*it);
47 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); 47 if(accounts->gr_name.find(QRegExp("^#"),0)) {// Skip commented lines.
48 groupComboBox->insertItem(accounts->gr_name); 48 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
49 groupComboBox->insertItem(accounts->gr_name);
50 }
49 } 51 }
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index 57efa71..1946013 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -128,12 +128,14 @@ void UserConfig::getUsers() {
128 accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.) 128 accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.)
129 new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos); 129 if(accounts->pw_name.find(QRegExp("^#"),0)) {// Skip commented lines.
130 if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) {// Is this user a "normal" user ? 130 new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos);
131 mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon. 131 if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) {// Is this user a "normal" user ?
132 if(!(mypixmap.load("/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"))) { // Is there an icon for this user? Resource::loadPixmap is caching, doesn't work. 132 mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon.
133 mypixmap=Resource::loadPixmap(QString("usermanager/usericon"));// If this user has no icon, load the default icon. 133 if(!(mypixmap.load("/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"))) { // Is there an icon for this user? Resource::loadPixmap is caching, doesn't work.
134 mypixmap=Resource::loadPixmap(QString("usermanager/usericon"));// If this user has no icon, load the default icon.
135 }
136 listviewitem=new QListViewItem(usersIconView,"",mytext);// Add the icon+text to the qiconview.
137 listviewitem->setPixmap(0,mypixmap);
134 } 138 }
135 listviewitem=new QListViewItem(usersIconView,"",mytext);// Add the icon+text to the qiconview. 139 if((accounts->pw_uid>=availableUID) && (accounts->pw_uid<65000)) availableUID=accounts->pw_uid+1; // Increase 1 to the latest know UID to get a free uid.
136 listviewitem->setPixmap(0,mypixmap);
137 } 140 }
138 if((accounts->pw_uid>=availableUID) && (accounts->pw_uid<65000)) availableUID=accounts->pw_uid+1; // Increase 1 to the latest know UID to get a free uid.
139 } 141 }
@@ -218,6 +220,8 @@ void UserConfig::getGroups() {
218 accounts->splitGroupEntry(*it);// Split the line into its components and fill the variables of 'accounts'. (gr_name, gr_uid & gr_mem). 220 accounts->splitGroupEntry(*it);// Split the line into its components and fill the variables of 'accounts'. (gr_name, gr_uid & gr_mem).
219 new QListViewItem(groupsListView,QString::number(accounts->gr_gid),accounts->gr_name); 221 if(accounts->gr_name.find(QRegExp("^#"),0)) {// Skip commented lines.
220 if((accounts->gr_gid>=availableGID) && (accounts->gr_gid<65000)) availableGID=accounts->gr_gid+1;// Maybe a new free GID. 222 new QListViewItem(groupsListView,QString::number(accounts->gr_gid),accounts->gr_name);
223 if((accounts->gr_gid>=availableGID) && (accounts->gr_gid<65000)) availableGID=accounts->gr_gid+1;// Maybe a new free GID.
224 }
221 } 225 }
222} 226}
223 227