Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index c06f639..19b0e84 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp | |||
@@ -380,62 +380,62 @@ bool UserDialog::editUser(const char *username) { | |||
380 | accounts->pw_shell=edituserDialog->shellComboBox->currentText(); | 380 | accounts->pw_shell=edituserDialog->shellComboBox->currentText(); |
381 | // Update userinfo, using the information stored in the user variables stored in the accounts object. | 381 | // Update userinfo, using the information stored in the user variables stored in the accounts object. |
382 | accounts->updateUser(username); | 382 | accounts->updateUser(username); |
383 | 383 | ||
384 | // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.) | 384 | // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.) |
385 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { | 385 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { |
386 | accounts->delGroupMember((*it).left((*it).find(":")),username); | 386 | accounts->delGroupMember((*it).left((*it).find(":")),username); |
387 | } | 387 | } |
388 | 388 | ||
389 | // Add User to additional groups that he/she is a member of. | 389 | // Add User to additional groups that he/she is a member of. |
390 | QListViewItemIterator it( edituserDialog->groupsListView ); | 390 | QListViewItemIterator it( edituserDialog->groupsListView ); |
391 | for ( ; it.current(); ++it ) { | 391 | for ( ; it.current(); ++it ) { |
392 | temp=(QCheckListItem*)it.current(); | 392 | temp=(QCheckListItem*)it.current(); |
393 | if ( temp->isOn() ) | 393 | if ( temp->isOn() ) |
394 | accounts->addGroupMember(it.current()->text(0),edituserDialog->loginLineEdit->text()); | 394 | accounts->addGroupMember(it.current()->text(0),edituserDialog->loginLineEdit->text()); |
395 | } | 395 | } |
396 | 396 | ||
397 | // Copy image to pics/users/ | 397 | // Copy image to pics/users/ |
398 | if(!(edituserDialog->userImage.isNull())) { | 398 | if(!(edituserDialog->userImage.isNull())) { |
399 | QDir d; | 399 | QDir d; |
400 | if(!(d.exists("/opt/QtPalmtop/pics/users"))) { | 400 | if(!(d.exists("/opt/QtPalmtop/pics/users"))) { |
401 | d.mkdir("/opt/QtPalmtop/pics/users"); | 401 | d.mkdir("/opt/QtPalmtop/pics/users"); |
402 | } | 402 | } |
403 | QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"; | 403 | QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"; |
404 | // edituserDialog->userImage=edituserDialog->userImage.smoothScale(48,48); | 404 | // edituserDialog->userImage=edituserDialog->userImage.smoothScale(48,48); |
405 | edituserDialog->userImage.save(filename,"PNG"); | 405 | edituserDialog->userImage.save(filename,"PNG"); |
406 | } | 406 | } |
407 | return true; | 407 | return true; |
408 | } | 408 | } |
409 | 409 | ||
410 | /** | 410 | /** |
411 | * "OK" has been clicked. Verify some information before closing the dialog. | 411 | * "OK" has been clicked. Verify some information before closing the dialog. |
412 | * | 412 | * |
413 | */ | 413 | */ |
414 | void UserDialog::accept() { | 414 | void UserDialog::accept() { |
415 | // Add checking... valid username? username taken? | 415 | // Add checking... valid username? username taken? |
416 | if(loginLineEdit->text().isEmpty()) { | 416 | if(loginLineEdit->text().isEmpty()) { |
417 | QMessageBox::information(0,"Empty Login","Please enter a login."); | 417 | QMessageBox::information(0,"Empty Login","Please enter a login."); |
418 | return; | 418 | return; |
419 | } | 419 | } |
420 | QDialog::accept(); | 420 | QDialog::accept(); |
421 | } | 421 | } |
422 | 422 | ||
423 | /** | 423 | /** |
424 | * This slot is called when the usericon is clicked, this loads (should) the iconselector. | 424 | * This slot is called when the usericon is clicked, this loads (should) the iconselector. |
425 | * | 425 | * |
426 | */ | 426 | */ |
427 | void UserDialog::clickedPicture() { | 427 | void UserDialog::clickedPicture() { |
428 | QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED,"/opt/QtPalmtop/pics"); | 428 | QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null); |
429 | if(!(filename.isEmpty())) { | 429 | if(!(filename.isEmpty())) { |
430 | userImage.reset(); | 430 | userImage.reset(); |
431 | if(!(userImage.load(filename))) { | 431 | if(!(userImage.load(filename))) { |
432 | QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename); | 432 | QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename); |
433 | } else { | 433 | } else { |
434 | // userImage=userImage.smoothScale(48,48); | 434 | // userImage=userImage.smoothScale(48,48); |
435 | QPixmap *picture; | 435 | QPixmap *picture; |
436 | picture=(QPixmap *)picturePushButton->pixmap(); | 436 | picture=(QPixmap *)picturePushButton->pixmap(); |
437 | picture->convertFromImage(userImage,0); | 437 | picture->convertFromImage(userImage,0); |
438 | picturePushButton->update(); | 438 | picturePushButton->update(); |
439 | } | 439 | } |
440 | } | 440 | } |
441 | } | 441 | } |