[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/icons
From:       Michael Pyne <mpyne () kde ! org>
Date:       2010-09-17 4:11:40
Message-ID: 20100917041140.7669BAC888 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1176228 by mpyne:

Use a global static for static QString data in KIconLoader::makeCacheKey.

ossi emailed me that fromLatin1 is preferred over fromAscii, which I honestly
didn't believe at first (how could latin-1 be any simpler than ASCII?), but
looking at the Qt source confirms that Latin-1 is at least handled more
efficiently.

But doing this conversion just once by making it a global static makes the
point kind of moot anyways.

I didn't see a large speedup here so hopefully this is as fast as we'll
reasonably get in this function.


 M  +4 -1      kiconloader.cpp  


--- trunk/KDE/kdelibs/kdeui/icons/kiconloader.cpp #1176227:1176228
@@ -62,6 +62,9 @@
 #include <assert.h>
 #include <kconfiggroup.h>
 
+// Used to make cache keys for icons with no group. Result type is QString*
+K_GLOBAL_STATIC_WITH_ARGS(QString, NULL_EFFECT_FINGERPRINT, (QString::fromLatin1("noeffect")))
+
 // Qt implements Tiny SVG specification. This specification does not cover important elements
 // that are pretty globally used on our icons, like blurring (and other filters). TT seems to have
 // no interest in supporting the full SVG specification (it would be slower, even with JS, CSS
@@ -771,7 +774,7 @@
            % QLatin1Char('_')
            % overlays.join("_")
            % ( group >= 0 ? mpEffect.fingerprint(group, state)
-                          : QString::fromAscii("noeffect"));
+                          : *NULL_EFFECT_FINGERPRINT);
 }
 
 QImage KIconLoaderPrivate::createIconImage(const QString &path, int size)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic