Debug warnings for broken icons
Urs Wolfer
uwolfer at kde.org
Wed Dec 19 18:57:34 GMT 2007
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broken_icon_warnings.patch
Type: text/x-diff
Size: 1534 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071219/c5fb6e7e/attachment.patch>
-------------- 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/20071219/c5fb6e7e/attachment.sig>
More information about the kde-core-devel
mailing list