[PATCH] Fix infinite recursion in KdeuiWidgetsProxyStyle

Aurélien Gâteau aurelien.gateau at free.fr
Wed Jun 11 22:26:33 BST 2008


You (may) know that KLineEdit uses KdeuiWidgetsProxyStyle to define the 
right margin necessary to show the "clear" button. To do so it uses a 
proxy of QStyle(): KdeuiWidgetsProxyStyle.

This causes infinite recursion when the KLineEdit parent uses 
QStyleSheetStyle because also acts as a proxy to the "base" style.

The first patch breaks the infinite recursion by detecting if the style 
proxied by KdeuiWidgetsProxyStyle is QStyleSheetStyle. It fixes a crash 
in Gwenview when one tries to edit places shown on the start page.
It also fixes most crashes caused by passing a custom stylesheet to the 
application from the command line. Konqueror still crashes, but Dolphin 
and Gwenview and a few others no longer crash.

The second patch reworks the way KLineEdit tells KLineEditStyle 
(inherited from KdeuiWidgetsProxyStyle) the margin to reserve for the 
"clear" button. I had to do so because after the first patch, the casts:


Would return 0 if the parent widget where using QStyleSheetStyle (I 
haven't figured out why).

Is it ok to apply?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-infinite-recursion-if-widget-uses-QStyleSheetSt.diff
Type: text/x-diff
Size: 2866 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080611/f1f296ec/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Store-overlap-in-KLineEditPrivate.diff
Type: text/x-diff
Size: 3911 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080611/f1f296ec/attachment-0001.diff>

More information about the kde-core-devel mailing list