summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qs60style_simulated.cpp
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-05-27 10:44:40 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-05-27 10:44:40 (GMT)
commit86d5c38d3f21a7d89dd619fa448a9c50527d8ba5 (patch)
tree1ff7cdac28b9c5b4937cb78752ec76f1021db7cb /src/gui/styles/qs60style_simulated.cpp
parent258e786e4faf801e38752f856fe0d3e2db520891 (diff)
downloadQt-86d5c38d3f21a7d89dd619fa448a9c50527d8ba5.zip
Qt-86d5c38d3f21a7d89dd619fa448a9c50527d8ba5.tar.gz
Qt-86d5c38d3f21a7d89dd619fa448a9c50527d8ba5.tar.bz2
S60Style: Keep the background texture in static QPixmap pointer.
Diffstat (limited to 'src/gui/styles/qs60style_simulated.cpp')
-rw-r--r--src/gui/styles/qs60style_simulated.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 65336ae..3edc874 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -193,24 +193,15 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const
QPixmap QS60StylePrivate::backgroundTexture()
{
- static QPixmap result;
- // Poor mans caching. + Making sure that there is always only one background image in memory at a time
-
-/*
- TODO: 1) Hold the background QPixmap as pointer in a static class member.
- Also add a deleteBackground() function and call that in ~QS60StylePrivate()
- 2) Don't cache the background at all as soon as we have native pixmap support
-*/
-
- if (!m_backgroundValid) {
- result = QPixmap();
+ if (!m_background) {
const QSize size = QApplication::activeWindow()?QApplication::activeWindow()->size():QSize(100, 100);
- result = part(QS60StyleEnums::SP_QsnBgScreen, size);
- m_backgroundValid = true;
+ QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size);
+ m_background = new QPixmap(background);
}
- return result;
+ return *m_background;
}
+
bool QS60StylePrivate::isTouchSupported()
{
#ifdef QT_KEYPAD_NAVIGATION