Bug 83387

Summary: make kdepasswd's exitcode useful [PATCH]
Product: [Applications] kdepasswd Reporter: Marcel Martin <mmar>
Component: generalAssignee: Geert Jansen <g.t.jansen>
Status: RESOLVED FIXED    
Severity: wishlist CC: finex
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: let exitcode make a bit more sense

Description Marcel Martin 2004-06-14 22:07:20 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

kdepasswd always exits with an exit code of 0 so you can't use it in shell scripts. The attached (attempt at a) patch lets kdepasswd return 1 if one of the dialogs were cancelled and 2 if a kdepasswd instance is already running.
I don't know if returning a non-zero exitcode for when an instance of the application is already running is consistent with what the rest of KDE does.
Comment 1 Marcel Martin 2004-06-14 22:10:49 UTC
Created attachment 6364 [details]
let exitcode make a bit more sense

Don't take this literally as I have only little experience in KDE programming.
Comment 2 Nicolas L. 2006-04-11 16:10:24 UTC
what about this patch ? is it good ? 
if yes can it be apply ?
Comment 3 FiNeX 2008-12-26 15:41:56 UTC
kdepasswd on KDE4 should be checked: is it right?
Comment 4 Marcel Martin 2008-12-26 21:40:56 UTC
I've just had a look: kdepasswd in KDE 4 still only returns 0, no matter whether the password was changed successfully or not. With tiny changes, the patch can still be applied.
Comment 5 FiNeX 2008-12-26 22:25:10 UTC
You're right. Thank Marcel, I'll commit it. It seems right.
Comment 6 FiNeX 2008-12-26 22:25:35 UTC
SVN commit 901895 by finex:

More useful return codes.

BUG: 83387



 M  +5 -3      kdepasswd.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=901895