summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-06-04 01:58:14 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-06-04 01:58:14 (GMT)
commitb296c72042fc9d8841c62f1b2028946b077a3b3a (patch)
tree0dab9eae4b288c1e3ea929141b1f0381afe87ca7 /src/declarative/util
parentd031b1aba3110776de4b70f8ffcb828f60b8b654 (diff)
parentde48af046a093834b8178238a2afb2efc8636efd (diff)
downloadQt-b296c72042fc9d8841c62f1b2028946b077a3b3a.zip
Qt-b296c72042fc9d8841c62f1b2028946b077a3b3a.tar.gz
Qt-b296c72042fc9d8841c62f1b2028946b077a3b3a.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Revert some of "Make QMLViewer startup animation stop after a while" Add private method for flushing the pixmap cache.
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp14
-rw-r--r--src/declarative/util/qdeclarativepixmapcache_p.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 07d3977..3557425 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -584,6 +584,7 @@ public:
void unreferencePixmap(QDeclarativePixmapData *);
void referencePixmap(QDeclarativePixmapData *);
+ void flushCache();
protected:
virtual void timerEvent(QTimerEvent *);
@@ -682,6 +683,14 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *)
}
}
+/*
+ Remove all unreferenced pixmaps from the cache.
+*/
+void QDeclarativePixmapStore::flushCache()
+{
+ shrinkCache(m_unreferencedCost);
+}
+
QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d)
: data(d), reader(0), requestSize(d->requestSize), loading(false), redirectCount(0)
{
@@ -1075,6 +1084,11 @@ bool QDeclarativePixmap::connectDownloadProgress(QObject *object, int method)
return QMetaObject::connect(d->reply, QDeclarativePixmapReply::downloadProgressIndex, object, method);
}
+void QDeclarativePixmap::flushCache()
+{
+ pixmapStore()->flushCache();
+}
+
QT_END_NAMESPACE
#include <qdeclarativepixmapcache.moc>
diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h
index 396c196..4976906 100644
--- a/src/declarative/util/qdeclarativepixmapcache_p.h
+++ b/src/declarative/util/qdeclarativepixmapcache_p.h
@@ -103,6 +103,8 @@ public:
bool connectDownloadProgress(QObject *, const char *);
bool connectDownloadProgress(QObject *, int);
+ static void flushCache();
+
private:
Q_DISABLE_COPY(QDeclarativePixmap)
QDeclarativePixmapData *d;