[BUG+PATCH]: updateToolTip(bool) called too often

Rafał Miłecki zajec5 at gmail.com
Mon Apr 7 13:06:39 CEST 2008


I found bug in calling updateToolTip(true). This method should be
called when (and only then) tooltip is not displayed and it is going
to be shown. Actually this is *also* called after using
setToolTip(...) which doesn't change tooltip's visibility at all.

I found this bug when reimplementing updateToolTip function in digital
clock. You may test this yourself applying my patch from this mail

THIS PATCH IS NOT BUG FIX.

If we will try to use updateToolTip in current state, we may
experience infinity loop. Please, imagine:

updateToolTip(bool update) {
    Plasma::ToolTipData tipData;
    tipData.mainText = "Something";
    setToolTip(tipData);
}

When user will hover widget, updateToolTip will be called. Code inside
updateToolTip use "setToolTip" so it'll cause calling updateToolTip
again. And so on...

-- 
Rafał Miłecki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: digital.clock.updateToolTip.test.patch
Type: application/octet-stream
Size: 1224 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080407/9bae6625/attachment-0001.obj 


More information about the Panel-devel mailing list