From kde-core-devel Sat Dec 22 18:44:19 2007 From: Urs Wolfer Date: Sat, 22 Dec 2007 18:44:19 +0000 To: kde-core-devel Subject: Re: Debug warnings for broken icons Message-Id: <200712221944.22088.uwolfer () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=119834925315782 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1492250.KJJNFq0Q1c" --nextPart1492250.KJJNFq0Q1c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 ic= on > 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 m= ake=20 sense as soon as this define will be ported to the new build system. Bye urs --nextPart1492250.KJJNFq0Q1c Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHbVsDooBDqI2Jn8gRAr8XAJ9EnqSTGyXI8SzSY0cSd48E/r87jQCgoiQ4 V/U++VnASM4PIb1nWNg4+3k= =14Fe -----END PGP SIGNATURE----- --nextPart1492250.KJJNFq0Q1c--