diff options
author | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2010-05-20 10:04:34 (GMT) |
---|---|---|
committer | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2010-05-20 10:04:34 (GMT) |
commit | 6fb92f77f6d6b5b685b8748a1a35ffbd7df8b76b (patch) | |
tree | ba9ec7bc61be5ae87bd93fa055c6fb628b3d8404 /src/gui/image/qicon.cpp | |
parent | 98972c1b271de1292b4e46484fe689d62a8b8e62 (diff) | |
parent | e6557220bccbdbbc218dc9eab0eb426ba774435e (diff) | |
download | Qt-6fb92f77f6d6b5b685b8748a1a35ffbd7df8b76b.zip Qt-6fb92f77f6d6b5b685b8748a1a35ffbd7df8b76b.tar.gz Qt-6fb92f77f6d6b5b685b8748a1a35ffbd7df8b76b.tar.bz2 |
Merge branch '4.7' of scm.dev.troll.no:qt/qt-s60-public into 4.7
Diffstat (limited to 'src/gui/image/qicon.cpp')
-rw-r--r-- | src/gui/image/qicon.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 891b1db..7696632 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -55,6 +55,7 @@ #include "qcache.h" #include "qdebug.h" #include "private/qguiplatformplugin_p.h" +#include "private/qstylehelper_p.h" #ifdef Q_WS_MAC #include <private/qt_mac_p.h> @@ -261,21 +262,17 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St if (!actualSize.isNull() && (actualSize.width() > size.width() || actualSize.height() > size.height())) actualSize.scale(size, Qt::KeepAspectRatio); - QString key = QLatin1String("$qt_icon_") - + QString::number(pm.cacheKey()) - + QString::number(pe->mode) - + QString::number(QApplication::palette().cacheKey()) - + QLatin1Char('_') - + QString::number(actualSize.width()) - + QLatin1Char('_') - + QString::number(actualSize.height()) - + QLatin1Char('_'); - + QString key = QLatin1Literal("qt_") + % HexString<quint64>(pm.cacheKey()) + % HexString<uint>(pe->mode) + % HexString<quint64>(QApplication::palette().cacheKey()) + % HexString<uint>(actualSize.width()) + % HexString<uint>(actualSize.height()); if (mode == QIcon::Active) { - if (QPixmapCache::find(key + QString::number(mode), pm)) + if (QPixmapCache::find(key % HexString<uint>(mode), pm)) return pm; // horray - if (QPixmapCache::find(key + QString::number(QIcon::Normal), pm)) { + if (QPixmapCache::find(key % HexString<uint>(QIcon::Normal), pm)) { QStyleOption opt(0); opt.palette = QApplication::palette(); QPixmap active = QApplication::style()->generatedIconPixmap(QIcon::Active, pm, &opt); @@ -284,7 +281,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St } } - if (!QPixmapCache::find(key + QString::number(mode), pm)) { + if (!QPixmapCache::find(key % HexString<uint>(mode), pm)) { if (pm.size() != actualSize) pm = pm.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); if (pe->mode != mode && mode != QIcon::Normal) { @@ -294,7 +291,7 @@ QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::St if (!generated.isNull()) pm = generated; } - QPixmapCache::insert(key + QString::number(mode), pm); + QPixmapCache::insert(key % HexString<uint>(mode), pm); } return pm; } |