summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-08-04 02:12:03 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-08-04 02:12:03 (GMT)
commitc3702db732744ea508522a96eb258d4873dd273f (patch)
treef9e3ed495fea03b5e3a04852804ad8592d29e562 /src/declarative/util
parent29d988d113aac1a193d3af6247a6e8231f3f3c9e (diff)
parent920ce5ed71bc456e429b887801a8d8bea7a3db0d (diff)
downloadQt-c3702db732744ea508522a96eb258d4873dd273f.zip
Qt-c3702db732744ea508522a96eb258d4873dd273f.tar.gz
Qt-c3702db732744ea508522a96eb258d4873dd273f.tar.bz2
Merge branch '4.8' of scm.dev.nokia.troll.no:qt/qt
Conflicts: doc/src/declarative/qtbinding.qdoc
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp14
-rw-r--r--src/declarative/util/qdeclarativepixmapcache_p.h2
-rw-r--r--src/declarative/util/qdeclarativestateoperations_p.h4
3 files changed, 18 insertions, 2 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;
diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h
index 6a6dda6..a05edb8 100644
--- a/src/declarative/util/qdeclarativestateoperations_p.h
+++ b/src/declarative/util/qdeclarativestateoperations_p.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeParentChangePrivate;
-class Q_AUTOTEST_EXPORT QDeclarativeParentChange : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeParentChange : public QDeclarativeStateOperation, public QDeclarativeActionEvent
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeParentChange)
@@ -251,7 +251,7 @@ private:
};
class QDeclarativeAnchorChangesPrivate;
-class Q_AUTOTEST_EXPORT QDeclarativeAnchorChanges : public QDeclarativeStateOperation, public QDeclarativeActionEvent
+class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchorChanges : public QDeclarativeStateOperation, public QDeclarativeActionEvent
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeAnchorChanges)