<br><br><div class="gmail_quote">2008/11/13 Albert Astals Cid <span dir="ltr"><<a href="mailto:aacid@kde.org" target="_blank">aacid@kde.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


A Dimecres 12 Novembre 2008, leo peng va escriure:<br>
<div><div></div><div>> I found that if I call "kcmshell4 kcm_useraccount" to change my password,<br>
> it does nothing.<br>
> in that window, I clicked "Change Password", then I input the same string<br>
> twice on the popup window, then<br>
> clicked Ok, but it will show error.<br>
><br>
> we use class KNewPasswordDialog::password() get input password in dialog,<br>
> we can get input password after<br>
>   KNewPasswordDialog::accept().<br>
> but we will get empty password before use KNewPasswordDialog::accept(),<br>
> so  set password for current user in<br>
> kdebase-4.1.2/apps/kdepasswd/passwddlg.cpp (class KDEpasswd2Dialog)<br>
><br>
> I think I fixed the bug, maybe.<br>
<br>
</div></div>This patch is not the correct fix, it completely bypasses the check done in<br>
KNewPasswordDialog::accept about both lines having the same text and the check<br>
about password strength.<br>
<br>
Alternative solutions include:<br>
 a) Creating a protected function in KNewPasswordDialog that does the checking<br>
done in KNewPasswordDialog::accept so one can call if from<br>
KDEpasswd2Dialog::accept<br>
<br>
 b) Overloading KNewPasswordDialog::checkPassword() in KDEpasswd2Dialog to do<br>
the checking.<br>
<br>
Albert<br>
<br>
>> Visit <a href="http://mail.kde.org/mailman/listinfo/kde-devel#unsub" target="_blank">http://mail.kde.org/mailman/listinfo/kde-devel#unsub</a> to unsubscribe <<<br>
</blockquote></div><br>I change my first patch,  and fix this problem, <br>I creat a protected function bool KNewPasswordDialog::checkAndGetPwd(QString &pwd) in KNewPasswordDialog,<br>    (please see patch : kdelibs-kdeui-dialogs-knewpassworddialog.patch)<br>
<br>this funtion be used in KDEpasswd2Dialog::accept , <br>    (please see patch : kdebase-apps-kdepasswd-passwddlg.patch)<br><br>I test it is ok.<br><br>please see attachment.<br>Thank you for your help, Albert.<br clear="all">
<br>-- <br>  best regards !<br>----------------------<br>leopeng<br>