summaryrefslogtreecommitdiff
path: root/noncore/settings/usermanager/userdialog.cpp
authorumopapisdn <umopapisdn>2003-03-22 00:31:44 (UTC)
committer umopapisdn <umopapisdn>2003-03-22 00:31:44 (UTC)
commitebf65f250904e0619c10b69a0428fcc538ffc167 (patch) (side-by-side diff)
tree1ed0ca90ff564a55116787acff758cb2e4dcb4f8 /noncore/settings/usermanager/userdialog.cpp
parentab8cb739c666f5f22049258a4bcbb06d1e1ad0c4 (diff)
downloadopie-ebf65f250904e0619c10b69a0428fcc538ffc167.zip
opie-ebf65f250904e0619c10b69a0428fcc538ffc167.tar.gz
opie-ebf65f250904e0619c10b69a0428fcc538ffc167.tar.bz2
Bugfix: Groupmembers should be separated by a comma and not by a space.
Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/userdialog.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index c82cc9d..0d2122b 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -333,11 +333,26 @@ bool UserDialog::editUser(const char *username) {
edituserDialog->groupComboBox->insertItem("<Undefined group>",0);
edituserDialog->groupComboBox->setCurrentItem(0);
}
+
// Select the groups in the listview, to which the user belongs.
QCheckListItem *temp;
- QRegExp userRegExp(QString("[:\\s]%1\\s").arg(username));
+ // BAH!!! QRegExp in qt2 sucks... or maybe I do... can't figure out how to check for EITHER end of input ($) OR a comma, so here we do two different QRegExps instead.
+ QRegExp userRegExp(QString("[:,]%1$").arg(username)); // The end of line variant.
QStringList tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { // Iterate over all of them.
+ qWarning(*it);
+ QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
+ for ( ; lvit.current(); ++lvit ) {
+ if(lvit.current()->text(0)==(*it).left((*it).find(":"))) {
+ temp=(QCheckListItem*)lvit.current();
+ temp->setOn(true); // If we find a line with that groupname, select it.;
+ }
+ }
+ }
+ userRegExp=QRegExp(QString("[:,]%1,").arg(username)); // And the other one. (not end of line.)
+ tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
+ for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { // Iterate over all of them.
+ qWarning(*it);
QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
for ( ; lvit.current(); ++lvit ) {
if(lvit.current()->text(0)==(*it).left((*it).find(":"))) {