diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-06-06 11:19:45 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-06-06 11:19:45 (GMT) |
commit | 872da4c22ed2a82c7e2624b8aef8ebba6c1323d9 (patch) | |
tree | cd786e093b64b8685a5d49bd48778a9650ee241f /src/declarative/util | |
parent | 1a74ca1d05c7c819db89a82de613d73244b7a980 (diff) | |
parent | ed2b7e6c592dcf24de2bf34a693f54b5dd569194 (diff) | |
download | Qt-872da4c22ed2a82c7e2624b8aef8ebba6c1323d9.zip Qt-872da4c22ed2a82c7e2624b8aef8ebba6c1323d9.tar.gz Qt-872da4c22ed2a82c7e2624b8aef8ebba6c1323d9.tar.bz2 |
Merge branch '4.7' into qt-4.8-from-4.7
Conflicts:
src/gui/painting/qpaintengine_raster.cpp
src/gui/text/qfontengine_ft.cpp
src/s60installs/bwins/QtGuiu.def
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache.cpp | 14 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache_p.h | 2 |
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; |