K3Icon killed - Commit ?

David Faure faure at kde.org
Mon Oct 1 09:23:08 BST 2007


On Monday 01 October 2007, Rafael Fernández López wrote:
> Hi all,
> 
> I have everything compiling and working. The ppatch is only for the
> kdelibs/kdeui/icons folder diff, the rest of the commits are for adaptation
> from K3Icon:: to KIconLoader:: and similars.
> 
> You can find it on:
> http://media.ereslibre.es/2007/10/kdelibs-kdeui-icons.diff
> 
> What needs to be explained is that K3Icon contained some information, but
> almost always the stuff was used like:
> 
> if (icon.isValid())
>    doSomethingWith(icon.path);
> 
> So, now, when we were returning a K3Icon, we return a QString. When this
> string is null (QString()) is like the icon wasn't valid, and when this
> string is not null, it contains the path of the icon.
> 
> Please review some magic changes done at KIconLoader::loadIcon(). I think
> I've done correctly but I'd like someone familiar with this code to double
> check it. Specially:
> 
>          // No? load it.
> -        K3Icon icon;
> +        QString icon;
>          if (absolutePath && !favIconOverlay)
>          {
> -            icon.context=K3Icon::Any;
> -            icon.type=K3Icon::Scalable;
> -            icon.path=name;
> +            iconType=Scalable;
> +            icon=name;
>          }
> 
> and
> 
> -        iconType = icon.type;
> -        iconThreshold = icon.threshold;
> -        path = icon.path;
> +        iconThreshold = 0;
> +        path = icon;
> 
> I haven't ever seen iconThreshold being changed...
It's set here:
./icons/kicontheme.cpp:484:     icon.threshold = dir->threshold();
and it's used here:
./icons/kiconloader.cpp:914:        if ( abs(size-img->width())>iconThreshold )
so it should not be set to 0.

The idea is to remove K3Icon from the *public API*, not to remove it from the kiconloader implementation.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list