summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-09-03 12:12:52 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-09-03 12:12:52 (GMT)
commitcb80c41e7bced1877312468e7f65e3a561e7d161 (patch)
tree4f8b9d8008b12e9c810705e8254182e2423310a3 /src/declarative/util
parentaacf7c5a8b98f0dd4039d7f7a9d0471c32034a3b (diff)
parentca68786e62e0e645b692dc19a87b7dc3b2219ffd (diff)
downloadQt-cb80c41e7bced1877312468e7f65e3a561e7d161.zip
Qt-cb80c41e7bced1877312468e7f65e3a561e7d161.tar.gz
Qt-cb80c41e7bced1877312468e7f65e3a561e7d161.tar.bz2
Merge branch '4.7' into qmldocs
Conflicts: doc/src/snippets/declarative/qml-intro/basic-syntax.qml
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp2
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp16
2 files changed, 10 insertions, 8 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 267642d..3c09747 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -332,7 +332,7 @@ void QDeclarativeAbstractAnimation::setAlwaysRunToEnd(bool f)
stopped - either by setting the \c running property to false, or by calling
the \c stop() method.
- In the following example, the rectangle will spin indefinately.
+ In the following example, the rectangle will spin indefinitely.
\code
Rectangle {
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index de2de21..4fc52f5 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -155,7 +155,7 @@ protected:
private:
friend class QDeclarativePixmapReaderThreadObject;
void processJobs();
- void processJob(QDeclarativePixmapReply *);
+ void processJob(QDeclarativePixmapReply *, const QUrl &, const QSize &);
void networkRequestDone(QNetworkReply *);
QList<QDeclarativePixmapReply*> jobs;
@@ -434,23 +434,24 @@ void QDeclarativePixmapReader::processJobs()
QDeclarativePixmapReply *runningJob = jobs.takeLast();
runningJob->loading = true;
+ QUrl url = runningJob->data->url;
+ QSize requestSize = runningJob->data->requestSize;
locker.unlock();
- processJob(runningJob);
+ processJob(runningJob, url, requestSize);
locker.relock();
}
}
}
-void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob)
+void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, const QUrl &url,
+ const QSize &requestSize)
{
- QUrl url = runningJob->data->url;
-
// fetch
if (url.scheme() == QLatin1String("image")) {
// Use QmlImageProvider
QSize readSize;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
- QImage image = ep->getImageFromProvider(url, &readSize, runningJob->data->requestSize);
+ QImage image = ep->getImageFromProvider(url, &readSize, requestSize);
QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError;
QString errorStr;
@@ -472,7 +473,7 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob)
QFile f(lf);
QSize readSize;
if (f.open(QIODevice::ReadOnly)) {
- if (!readImage(url, &f, &image, &errorStr, &readSize, runningJob->data->requestSize))
+ if (!readImage(url, &f, &image, &errorStr, &readSize, requestSize))
errorCode = QDeclarativePixmapReply::Loading;
} else {
errorStr = QDeclarativePixmap::tr("Cannot open: %1").arg(url.toString());
@@ -663,6 +664,7 @@ void QDeclarativePixmapStore::shrinkCache(int remove)
data->prevUnreferenced = 0;
remove -= data->cost();
+ m_unreferencedCost -= data->cost();
data->removeFromCache();
delete data;
}