Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 149 |
1 files changed, 100 insertions, 49 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index d87a005..08de352 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp | |||
@@ -9,5 +9,11 @@ | |||
9 | 9 | ||
10 | #include "userdialog.h" | 10 | #include "userdialog.h" |
11 | #include "passwd.h" | ||
12 | |||
13 | /* OPIE */ | ||
14 | #include <opie/odevice.h> | ||
15 | #include <qpe/qpeapplication.h> | ||
11 | 16 | ||
17 | /* QT */ | ||
12 | #include <qlayout.h> | 18 | #include <qlayout.h> |
13 | #include <qlabel.h> | 19 | #include <qlabel.h> |
@@ -15,4 +21,5 @@ | |||
15 | #include <qfile.h> | 21 | #include <qfile.h> |
16 | 22 | ||
23 | /* STD */ | ||
17 | #include <sys/types.h> | 24 | #include <sys/types.h> |
18 | #include <sys/wait.h> | 25 | #include <sys/wait.h> |
@@ -20,7 +27,5 @@ | |||
20 | #include <signal.h> | 27 | #include <signal.h> |
21 | 28 | ||
22 | #include "passwd.h" | ||
23 | 29 | ||
24 | #include <opie/odevice.h> | ||
25 | using namespace Opie; | 30 | using namespace Opie; |
26 | 31 | ||
@@ -30,5 +35,6 @@ using namespace Opie; | |||
30 | * | 35 | * |
31 | */ | 36 | */ |
32 | UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) { | 37 | UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) |
38 | { | ||
33 | vm=viewmode; | 39 | vm=viewmode; |
34 | QVBoxLayout *layout = new QVBoxLayout(this); | 40 | QVBoxLayout *layout = new QVBoxLayout(this); |
@@ -40,12 +46,14 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod | |||
40 | accounts->groupStringList.sort(); | 46 | accounts->groupStringList.sort(); |
41 | // And also fill the listview & the combobox with all available groups. | 47 | // And also fill the listview & the combobox with all available groups. |
42 | for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) { | 48 | for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) |
49 | { | ||
43 | accounts->splitGroupEntry(*it); | 50 | accounts->splitGroupEntry(*it); |
44 | if(accounts->gr_name.find(QRegExp("^#"),0)) {// Skip commented lines. | 51 | if(accounts->gr_name.find(QRegExp("^#"),0)) |
52 | {// Skip commented lines. | ||
45 | new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); | 53 | new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); |
46 | groupComboBox->insertItem(accounts->gr_name); | 54 | groupComboBox->insertItem(accounts->gr_name); |
47 | } | 55 | } |
48 | } | 56 | } |
49 | showMaximized(); | 57 | QPEApplication::showDialog( this ); |
50 | } | 58 | } |
51 | 59 | ||
@@ -54,6 +62,6 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod | |||
54 | * | 62 | * |
55 | */ | 63 | */ |
56 | UserDialog::~UserDialog() { | 64 | UserDialog::~UserDialog() |
57 | } | 65 | {} |
58 | 66 | ||
59 | /** | 67 | /** |
@@ -61,5 +69,6 @@ UserDialog::~UserDialog() { | |||
61 | * | 69 | * |
62 | */ | 70 | */ |
63 | void UserDialog::setupTab1() { | 71 | void UserDialog::setupTab1() |
72 | { | ||
64 | QPixmap mypixmap; | 73 | QPixmap mypixmap; |
65 | QWidget *tabpage = new QWidget(myTabWidget,"page1"); | 74 | QWidget *tabpage = new QWidget(myTabWidget,"page1"); |
@@ -110,5 +119,6 @@ void UserDialog::setupTab1() { | |||
110 | groupComboBox=new QComboBox(tabpage,"PrimaryGroup"); | 119 | groupComboBox=new QComboBox(tabpage,"PrimaryGroup"); |
111 | 120 | ||
112 | if(vm==VIEWMODE_NEW) { | 121 | if(vm==VIEWMODE_NEW) |
122 | { | ||
113 | // Copy /etc/skel | 123 | // Copy /etc/skel |
114 | skelLabel=new QLabel(tabpage,"skel"); | 124 | skelLabel=new QLabel(tabpage,"skel"); |
@@ -137,5 +147,6 @@ void UserDialog::setupTab1() { | |||
137 | vlayout1->addSpacing(5); | 147 | vlayout1->addSpacing(5); |
138 | vlayout1->addWidget(groupLabel); | 148 | vlayout1->addWidget(groupLabel); |
139 | if(vm==VIEWMODE_NEW) { | 149 | if(vm==VIEWMODE_NEW) |
150 | { | ||
140 | vlayout1->addSpacing(5); | 151 | vlayout1->addSpacing(5); |
141 | vlayout1->addWidget(skelLabel); | 152 | vlayout1->addWidget(skelLabel); |
@@ -153,5 +164,6 @@ void UserDialog::setupTab1() { | |||
153 | vlayout2->addSpacing(5); | 164 | vlayout2->addSpacing(5); |
154 | vlayout2->addWidget(groupComboBox); | 165 | vlayout2->addWidget(groupComboBox); |
155 | if(vm==VIEWMODE_NEW) { | 166 | if(vm==VIEWMODE_NEW) |
167 | { | ||
156 | vlayout2->addSpacing(5); | 168 | vlayout2->addSpacing(5); |
157 | vlayout2->addWidget(skelCheckBox); | 169 | vlayout2->addWidget(skelCheckBox); |
@@ -167,5 +179,6 @@ void UserDialog::setupTab1() { | |||
167 | * | 179 | * |
168 | */ | 180 | */ |
169 | void UserDialog::setupTab2() { | 181 | void UserDialog::setupTab2() |
182 | { | ||
170 | QWidget *tabpage = new QWidget(myTabWidget,"page2"); | 183 | QWidget *tabpage = new QWidget(myTabWidget,"page2"); |
171 | QVBoxLayout *layout = new QVBoxLayout(tabpage); | 184 | QVBoxLayout *layout = new QVBoxLayout(tabpage); |
@@ -196,5 +209,6 @@ void UserDialog::setupTab2() { | |||
196 | * | 209 | * |
197 | */ | 210 | */ |
198 | bool UserDialog::addUser(int uid, int gid) { | 211 | bool UserDialog::addUser(int uid, int gid) |
212 | { | ||
199 | QCheckListItem *temp; | 213 | QCheckListItem *temp; |
200 | QFile ozTest; | 214 | QFile ozTest; |
@@ -210,7 +224,9 @@ bool UserDialog::addUser(int uid, int gid) { | |||
210 | adduserDialog->uidLineEdit->setText(QString::number(uid)); | 224 | adduserDialog->uidLineEdit->setText(QString::number(uid)); |
211 | // If we're running on OZ, add new users to some default groups. | 225 | // If we're running on OZ, add new users to some default groups. |
212 | if(oz) { | 226 | if(oz) |
227 | { | ||
213 | QListViewItemIterator iter( adduserDialog->groupsListView ); | 228 | QListViewItemIterator iter( adduserDialog->groupsListView ); |
214 | for ( ; iter.current(); ++iter ) { | 229 | for ( ; iter.current(); ++iter ) |
230 | { | ||
215 | temp=(QCheckListItem*)iter.current(); | 231 | temp=(QCheckListItem*)iter.current(); |
216 | if (temp->text()=="video") temp->setOn(true); | 232 | if (temp->text()=="video") temp->setOn(true); |
@@ -225,5 +241,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
225 | // Show the dialog! | 241 | // Show the dialog! |
226 | if(!(adduserDialog->exec())) return false; | 242 | if(!(adduserDialog->exec())) return false; |
227 | if((adduserDialog->groupComboBox->currentItem()!=0)) { | 243 | if((adduserDialog->groupComboBox->currentItem()!=0)) |
244 | { | ||
228 | accounts->findGroup(adduserDialog->groupComboBox->currentText()); | 245 | accounts->findGroup(adduserDialog->groupComboBox->currentText()); |
229 | adduserDialog->groupID=accounts->gr_gid; | 246 | adduserDialog->groupID=accounts->gr_gid; |
@@ -232,5 +249,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
232 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), | 249 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), |
233 | adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), | 250 | adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), |
234 | QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) { | 251 | QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) |
252 | { | ||
235 | QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); | 253 | QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); |
236 | return false; | 254 | return false; |
@@ -239,5 +257,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
239 | // Add User to additional groups. | 257 | // Add User to additional groups. |
240 | QListViewItemIterator it( adduserDialog->groupsListView ); | 258 | QListViewItemIterator it( adduserDialog->groupsListView ); |
241 | for ( ; it.current(); ++it ) { | 259 | for ( ; it.current(); ++it ) |
260 | { | ||
242 | temp=(QCheckListItem*)it.current(); | 261 | temp=(QCheckListItem*)it.current(); |
243 | if (temp->isOn() ) | 262 | if (temp->isOn() ) |
@@ -245,7 +264,9 @@ bool UserDialog::addUser(int uid, int gid) { | |||
245 | } | 264 | } |
246 | // Copy image to pics/users/ | 265 | // Copy image to pics/users/ |
247 | if(!(adduserDialog->userImage.isNull())) { | 266 | if(!(adduserDialog->userImage.isNull())) |
267 | { | ||
248 | QDir d; | 268 | QDir d; |
249 | if(!(d.exists("/opt/QtPalmtop/pics/users"))) { | 269 | if(!(d.exists("/opt/QtPalmtop/pics/users"))) |
270 | { | ||
250 | d.mkdir("/opt/QtPalmtop/pics/users"); | 271 | d.mkdir("/opt/QtPalmtop/pics/users"); |
251 | } | 272 | } |
@@ -257,5 +278,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
257 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? | 278 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? |
258 | accounts->findUser(adduserDialog->loginLineEdit->text()); | 279 | accounts->findUser(adduserDialog->loginLineEdit->text()); |
259 | if(adduserDialog->skelCheckBox->isChecked()) { | 280 | if(adduserDialog->skelCheckBox->isChecked()) |
281 | { | ||
260 | QString command_cp; | 282 | QString command_cp; |
261 | QString command_chown; | 283 | QString command_chown; |
@@ -281,10 +303,15 @@ bool UserDialog::addUser(int uid, int gid) { | |||
281 | * | 303 | * |
282 | */ | 304 | */ |
283 | bool UserDialog::delUser(const char *username) { | 305 | bool UserDialog::delUser(const char *username) |
284 | if((accounts->findUser(username))) {// Does that user exist? | 306 | { |
285 | if(!(accounts->delUser(username))) {// Delete the user. | 307 | if((accounts->findUser(username))) |
308 | {// Does that user exist? | ||
309 | if(!(accounts->delUser(username))) | ||
310 | {// Delete the user. | ||
286 | QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+"."); | 311 | QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+"."); |
287 | } | 312 | } |
288 | } else { | 313 | } |
314 | else | ||
315 | { | ||
289 | QMessageBox::information(0,"Invalid Username","That username ("+QString(username)+")does not exist."); | 316 | QMessageBox::information(0,"Invalid Username","That username ("+QString(username)+")does not exist."); |
290 | return false; | 317 | return false; |
@@ -302,5 +329,6 @@ bool UserDialog::delUser(const char *username) { | |||
302 | * | 329 | * |
303 | */ | 330 | */ |
304 | bool UserDialog::editUser(const char *username) { | 331 | bool UserDialog::editUser(const char *username) |
332 | { | ||
305 | int invalid_group=0; | 333 | int invalid_group=0; |
306 | // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating edituserDialog's widgets here. | 334 | // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating edituserDialog's widgets here. |
@@ -308,5 +336,6 @@ bool UserDialog::editUser(const char *username) { | |||
308 | edituserDialog->setCaption(tr("Edit User")); | 336 | edituserDialog->setCaption(tr("Edit User")); |
309 | accounts->findUser(username);// Locate user in database and fill variables in 'accounts' object. | 337 | accounts->findUser(username);// Locate user in database and fill variables in 'accounts' object. |
310 | if(!(accounts->findGroup(accounts->pw_gid))) {// Locate the user's primary group, and fill group variables in 'accounts' object. | 338 | if(!(accounts->findGroup(accounts->pw_gid))) |
339 | {// Locate the user's primary group, and fill group variables in 'accounts' object. | ||
311 | invalid_group=1; | 340 | invalid_group=1; |
312 | } | 341 | } |
@@ -318,16 +347,20 @@ bool UserDialog::editUser(const char *username) { | |||
318 | edituserDialog->passwordLineEdit->setText("........"); | 347 | edituserDialog->passwordLineEdit->setText("........"); |
319 | // If this user is not using /bin/sh,/bin/ash or /bin/false as shell, add that entry to the shell-combobox. | 348 | // If this user is not using /bin/sh,/bin/ash or /bin/false as shell, add that entry to the shell-combobox. |
320 | if(accounts->pw_shell!="/bin/sh" && accounts->pw_shell!="/bin/ash" && accounts->pw_shell!="/bin/false") { | 349 | if(accounts->pw_shell!="/bin/sh" && accounts->pw_shell!="/bin/ash" && accounts->pw_shell!="/bin/false") |
350 | { | ||
321 | edituserDialog->shellComboBox->insertItem(accounts->pw_shell,0); | 351 | edituserDialog->shellComboBox->insertItem(accounts->pw_shell,0); |
322 | edituserDialog->shellComboBox->setCurrentItem(0); | 352 | edituserDialog->shellComboBox->setCurrentItem(0); |
323 | } | 353 | } |
324 | // Select the primary group for this user. | 354 | // Select the primary group for this user. |
325 | for(int i=0;i<edituserDialog->groupComboBox->count();++i) { | 355 | for(int i=0;i<edituserDialog->groupComboBox->count();++i) |
326 | if(accounts->gr_name==edituserDialog->groupComboBox->text(i)) { | 356 | { |
357 | if(accounts->gr_name==edituserDialog->groupComboBox->text(i)) | ||
358 | { | ||
327 | edituserDialog->groupComboBox->setCurrentItem(i); | 359 | edituserDialog->groupComboBox->setCurrentItem(i); |
328 | break; | 360 | break; |
329 | } | 361 | } |
330 | } | 362 | } |
331 | if(invalid_group) { | 363 | if(invalid_group) |
364 | { | ||
332 | edituserDialog->groupComboBox->insertItem("<Undefined group>",0); | 365 | edituserDialog->groupComboBox->insertItem("<Undefined group>",0); |
333 | edituserDialog->groupComboBox->setCurrentItem(0); | 366 | edituserDialog->groupComboBox->setCurrentItem(0); |
@@ -339,9 +372,12 @@ bool UserDialog::editUser(const char *username) { | |||
339 | QRegExp userRegExp(QString("[:,]%1$").arg(username));// The end of line variant. | 372 | QRegExp userRegExp(QString("[:,]%1$").arg(username));// The end of line variant. |
340 | QStringList tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. | 373 | QStringList tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. |
341 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) {// Iterate over all of them. | 374 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) |
375 | {// Iterate over all of them. | ||
342 | qWarning(*it); | 376 | qWarning(*it); |
343 | QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. | 377 | QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. |
344 | for ( ; lvit.current(); ++lvit ) { | 378 | for ( ; lvit.current(); ++lvit ) |
345 | if(lvit.current()->text(0)==(*it).left((*it).find(":"))) { | 379 | { |
380 | if(lvit.current()->text(0)==(*it).left((*it).find(":"))) | ||
381 | { | ||
346 | temp=(QCheckListItem*)lvit.current(); | 382 | temp=(QCheckListItem*)lvit.current(); |
347 | temp->setOn(true);// If we find a line with that groupname, select it.; | 383 | temp->setOn(true);// If we find a line with that groupname, select it.; |
@@ -351,9 +387,12 @@ bool UserDialog::editUser(const char *username) { | |||
351 | userRegExp=QRegExp(QString("[:,]%1,").arg(username));// And the other one. (not end of line.) | 387 | userRegExp=QRegExp(QString("[:,]%1,").arg(username));// And the other one. (not end of line.) |
352 | tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. | 388 | tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. |
353 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) {// Iterate over all of them. | 389 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) |
390 | {// Iterate over all of them. | ||
354 | qWarning(*it); | 391 | qWarning(*it); |
355 | QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. | 392 | QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. |
356 | for ( ; lvit.current(); ++lvit ) { | 393 | for ( ; lvit.current(); ++lvit ) |
357 | if(lvit.current()->text(0)==(*it).left((*it).find(":"))) { | 394 | { |
395 | if(lvit.current()->text(0)==(*it).left((*it).find(":"))) | ||
396 | { | ||
358 | temp=(QCheckListItem*)lvit.current(); | 397 | temp=(QCheckListItem*)lvit.current(); |
359 | temp->setOn(true);// If we find a line with that groupname, select it.; | 398 | temp->setOn(true);// If we find a line with that groupname, select it.; |
@@ -371,5 +410,6 @@ bool UserDialog::editUser(const char *username) { | |||
371 | // Set all variables in accounts object, that will be used when calling 'updateUser()' | 410 | // Set all variables in accounts object, that will be used when calling 'updateUser()' |
372 | accounts->pw_uid=edituserDialog->uidLineEdit->text().toInt(); | 411 | accounts->pw_uid=edituserDialog->uidLineEdit->text().toInt(); |
373 | if(accounts->findGroup(edituserDialog->groupComboBox->currentText())) {// Fill all group variables in 'accounts' object. | 412 | if(accounts->findGroup(edituserDialog->groupComboBox->currentText())) |
413 | {// Fill all group variables in 'accounts' object. | ||
374 | accounts->pw_gid=accounts->gr_gid;// Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group. | 414 | accounts->pw_gid=accounts->gr_gid;// Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group. |
375 | } | 415 | } |
@@ -380,5 +420,6 @@ bool UserDialog::editUser(const char *username) { | |||
380 | 420 | ||
381 | // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.) | 421 | // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.) |
382 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { | 422 | for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) |
423 | { | ||
383 | accounts->delGroupMember((*it).left((*it).find(":")),username); | 424 | accounts->delGroupMember((*it).left((*it).find(":")),username); |
384 | } | 425 | } |
@@ -386,5 +427,6 @@ bool UserDialog::editUser(const char *username) { | |||
386 | // Add User to additional groups that he/she is a member of. | 427 | // Add User to additional groups that he/she is a member of. |
387 | QListViewItemIterator it( edituserDialog->groupsListView ); | 428 | QListViewItemIterator it( edituserDialog->groupsListView ); |
388 | for ( ; it.current(); ++it ) { | 429 | for ( ; it.current(); ++it ) |
430 | { | ||
389 | temp=(QCheckListItem*)it.current(); | 431 | temp=(QCheckListItem*)it.current(); |
390 | if ( temp->isOn() ) | 432 | if ( temp->isOn() ) |
@@ -393,7 +435,9 @@ bool UserDialog::editUser(const char *username) { | |||
393 | 435 | ||
394 | // Copy image to pics/users/ | 436 | // Copy image to pics/users/ |
395 | if(!(edituserDialog->userImage.isNull())) { | 437 | if(!(edituserDialog->userImage.isNull())) |
438 | { | ||
396 | QDir d; | 439 | QDir d; |
397 | if(!(d.exists("/opt/QtPalmtop/pics/users"))) { | 440 | if(!(d.exists("/opt/QtPalmtop/pics/users"))) |
441 | { | ||
398 | d.mkdir("/opt/QtPalmtop/pics/users"); | 442 | d.mkdir("/opt/QtPalmtop/pics/users"); |
399 | } | 443 | } |
@@ -409,7 +453,9 @@ bool UserDialog::editUser(const char *username) { | |||
409 | * | 453 | * |
410 | */ | 454 | */ |
411 | void UserDialog::accept() { | 455 | void UserDialog::accept() |
456 | { | ||
412 | // Add checking... valid username? username taken? | 457 | // Add checking... valid username? username taken? |
413 | if(loginLineEdit->text().isEmpty()) { | 458 | if(loginLineEdit->text().isEmpty()) |
459 | { | ||
414 | QMessageBox::information(0,"Empty Login","Please enter a login."); | 460 | QMessageBox::information(0,"Empty Login","Please enter a login."); |
415 | return; | 461 | return; |
@@ -422,11 +468,16 @@ void UserDialog::accept() { | |||
422 | * | 468 | * |
423 | */ | 469 | */ |
424 | void UserDialog::clickedPicture() { | 470 | void UserDialog::clickedPicture() |
471 | { | ||
425 | QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null); | 472 | QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null); |
426 | if(!(filename.isEmpty())) { | 473 | if(!(filename.isEmpty())) |
474 | { | ||
427 | userImage.reset(); | 475 | userImage.reset(); |
428 | if(!(userImage.load(filename))) { | 476 | if(!(userImage.load(filename))) |
477 | { | ||
429 | QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename); | 478 | QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename); |
430 | } else { | 479 | } |
480 | else | ||
481 | { | ||
431 | // userImage=userImage.smoothScale(48,48); | 482 | // userImage=userImage.smoothScale(48,48); |
432 | QPixmap *picture; | 483 | QPixmap *picture; |