[PATCH] KFontChooser crashes when changing to fixed fonts

Thomas McGuire Thomas.McGuire at gmx.net
Sat Feb 23 21:27:45 GMT 2008


KFontChooser crashes when calling setFont() with onlyFixed = true as 
parameter. The reason is in setFamilyBoxItems(), which updates the font list. 
In there, clear() is called to empty the list. This causes a signal to be 
emitted and then _k_family_chosen_slot() is called, which relies on the list 
being non-empty. It is emtpy though, and therefore it will crash.

The attached patch checks if there is a current item in the list. If not, 
_k_family_chosen_slot() will simply return and do nothing.

This crash can be reproduced in KMail by choosing "Fixed Width Font" from the 
font list in the config dialog.

Ok to commit?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fontchooser.diff
Type: text/x-diff
Size: 496 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080223/96331b9f/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080223/96331b9f/attachment.sig>

More information about the kde-core-devel mailing list