Debug warnings for broken icons

Urs Wolfer uwolfer at kde.org
Sat Dec 22 18:44:19 GMT 2007


On Wednesday 19 December 2007 19.57:34 Urs Wolfer wrote:
> Hi all
>
> I have had the idea to throw debug warnings about missing or wrong spelled
> icons in apps. It's something like the runtime debug warnings about broken
> connections in Qt.
>
> Example:
> khelpcenter(28217)/kdeui (KIconLoader) KIconLoader::loadIcon: No such
> icon "thumbnail"
>
> It would help us to detect and fix such cases:
> * You can see it quite fast in the debug output when there is an icon
> missing. A good testcase is for example the "Configure Toolbar" dialog.
>
> * You can see the name of the broken icon in the debug. This makes it very
> easy to find the ussage(s) of this icon in the source code. Just do a
> simple grep in the application source folder (grep "\"brokenicon\"" * -R).
>
> There is one problem: we will see this warning only once because of the
> icon cache. Currently, the icon cache caches the "unknown" icon if the icon
> is broken. There is not a really nice solution for this issue: either we
> don't cache broken images, so we can see it every time an app calls such an
> icon, or we output the warning only once. I have discussed that with Rivo
> (the author of the icon cache). We found a solution, but only for 4.1
> because it adds some new features. For the moment, I prefer the way to not
> cache broken icons. This makes it way easier to find and fix such icons. Of
> course it would be nice if we have a #define when we compile kdelibs in
> debug mode (is that possible?). Then we could just not insert it into the
> cache when we are in debug mode.
>
> Okay to commit this patch?
>
> Bye
> urs

Committed in r751742.

Thanks for the hint about '#ifndef NDEBUG'. I have used that, and it will make 
sense as soon as this define will be ported to the new build system.

Bye
urs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071222/913bb263/attachment.sig>


More information about the kde-core-devel mailing list