KIconLoader loadIcon and overlays/emblems API change

Zack Rusin zack at kde.org
Tue Jul 24 13:55:45 BST 2007


On Monday 23 July 2007 09:08:09 pm Aaron J. Seigo wrote:
> hi all...
>
> the goal was to provide a way to have multiple overlays and not just the
> few that were defined via an emum. that isn't extensible (as in new
> overlays can't be added easily or in a back/forwards compatible way) and it
> also doesn't work very well with the icon naming spec's emblem-* icons.

wicked =)

Comment:
The signature for icon methods is:
QPixmap *Icon(const QString& name, int size=0,
                  int state=K3Icon::DefaultState, const QStringList &overlays
			 = QStringList());
And then in the method loading the emblems you iterate over the string list 
and from what i see:
overlays[0] == bottom left corner
overlays[1] == bottom right corner
overlays[2] == top right corner
overlays[3] == top left corner
if e.g. overlays[1] is an empty string than overlays[2] will be promoted to 
bottom right corner. So there's no way of specifying an emblem in for 
example, only, top left corner.
How about we change const QStringList &overlays to const QMap<Qt::Corner, 
QString> &overlays?
The initialization of the corners in that case would be
overlays[Qt::TopLeftCorner] = QLatin1String("love");
(assuming we'll have "love" emblem) and the order wouldn't have any 
special/magical meaning anymore.

z




More information about the kde-core-devel mailing list