[PATCH] Using KIcon for icons with overlay

Aaron J. Seigo aseigo at kde.org
Wed Aug 29 18:30:48 BST 2007


On Wednesday 29 August 2007, Gustavo Pichorim Boiko wrote:
> Should I understand this silence as an approval for my API suggestion?

sorry, i was taking a semi-vacation when this was posted to the list.

first, i think there is a technical problem with the patch in that it call 
mIconCache->discard() when setEffect is called. i think this is hardly what 
is desired as it will penalize each and every kde app and really invalidate 
the point and purpose of mIconCache. the effect modifiers need to be added to 
the cache key, which then insures the iconcache doesn't need to get 
discarded.

beyond that bug .... i'm pretty torn with this patch since it really doesn't 
seem to be the "right place" for this code and seems to fix an issue for 
kopete the way kopete needs it rather than in a general way. specifically, it 
duplicates the purpose of KIconEffect and adds even more overhead to the icon 
loader.

looking at the code, it seems this ought to go, at least in part, into 
KIconEffect. in fact, with a quick glance all KIconEffect is missing is a 
setEffect(int group, int state, KIconEffect::Effects effect, float value, 
const QColor &color) method.

then kopete could do sth like:

iconLoader->iconEffect()->setEffect(..)

and it should be applied to the icon. the other half of this would be to allow 
one to inhibit the application of this effect to the icons loaded in 
drawOverlay. perhaps a overlaysUseEffects and setOverlaysUserEffects? it 
would default to true, of course, and then the call to loadIcon in 
Private::drawOverlays would need to be modified in some way to obey that 
setting.

i really wish these things could be done in KIcon itself but the QIconEngine 
related API is far too limiting =/

looking at it a bit closer, does your patch even work? i ask because 
drawOverlays calls loadIcon, which seems to apply the effect no matter what 
so it would also get applied to the loaded overlay emblems, no?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070829/c0617de6/attachment.sig>


More information about the kde-core-devel mailing list