[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/kdepasswd
From:       Leonardo Finetti <finex () finex ! org>
Date:       2008-12-26 21:25:34
Message-ID: 1230326734.637667.24015.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 901895 by finex:

More useful return codes.

BUG: 83387



 M  +5 -3      kdepasswd.cpp  


--- trunk/KDE/kdebase/apps/kdepasswd/kdepasswd.cpp #901894:901895
@@ -55,7 +55,7 @@
 
     if (!KUniqueApplication::start()) {
         kDebug() << "kdepasswd is already running";
-        return 0;
+        return 2;
     }
 
     KUniqueApplication app;
@@ -72,7 +72,7 @@
     if ( !user.isEmpty() && user!=KUser().loginName() && !bRoot)
     {
         KMessageBox::sorry(0, i18n("You need to be root to change the password of other users."));
-        return 0;
+        return 1;
     }
 
     QByteArray oldpass;
@@ -80,13 +80,15 @@
     {
         int result = KDEpasswd1Dialog::getPassword(oldpass);
         if (result != KDEpasswd1Dialog::Accepted)
-            return 0;
+            return 1;
     }
 
     KDEpasswd2Dialog *dlg = new KDEpasswd2Dialog(oldpass, user.toLocal8Bit());
 
 
     dlg->exec();
+    if (dlg->result() == KDEpasswd2Dialog::Rejected)
+        return 1;
 
     return 0;
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic