summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-01 21:53:47 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-01 21:53:47 (GMT)
commite93f76cc533751944e66c02d868f3c527814efa0 (patch)
tree9a79f06ad7be400ff432a7edae33be4599a0658c /src/declarative/util
parentbd95a353c621cb7dba2f0991e742ddbde0bb9a54 (diff)
parent652be80c25f61aa4fbf28d75ba9971fc709f29c9 (diff)
downloadQt-e93f76cc533751944e66c02d868f3c527814efa0.zip
Qt-e93f76cc533751944e66c02d868f3c527814efa0.tar.gz
Qt-e93f76cc533751944e66c02d868f3c527814efa0.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qmlanimation.cpp2
-rw-r--r--src/declarative/util/qmlpixmapcache.cpp9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index efb4159..63044bc 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -223,7 +223,7 @@ void QmlAbstractAnimationPrivate::commence()
QmlMetaProperty QmlAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj)
{
- QmlMetaProperty prop = QmlMetaProperty::createProperty(obj, str);
+ QmlMetaProperty prop = QmlMetaProperty::createProperty(obj, str, qmlContext(infoObj));
if (!prop.isValid()) {
qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate non-existant property \"%1\"").arg(str);
return QmlMetaProperty();
diff --git a/src/declarative/util/qmlpixmapcache.cpp b/src/declarative/util/qmlpixmapcache.cpp
index 331c0ce..bfe99ac 100644
--- a/src/declarative/util/qmlpixmapcache.cpp
+++ b/src/declarative/util/qmlpixmapcache.cpp
@@ -404,7 +404,7 @@ bool QmlPixmapReply::event(QEvent *event)
d->pixmap = QPixmap::fromImage(de->image);
QByteArray key = d->url.toEncoded(QUrl::FormattingOption(0x100));
QString strKey = QString::fromLatin1(key.constData(), key.count());
- QPixmapCache::insert(strKey, d->pixmap);
+ QPixmapCache::insert(strKey, d->pixmap); // note: may fail (returns false)
emit finished();
}
return true;
@@ -499,7 +499,12 @@ QmlPixmapReply::Status QmlPixmapCache::get(const QUrl& url, QPixmap *pixmap)
QByteArray key = url.toEncoded(QUrl::FormattingOption(0x100));
QString strKey = QString::fromLatin1(key.constData(), key.count());
QmlPixmapReplyHash::Iterator iter = qmlActivePixmapReplies()->find(url);
- if (QPixmapCache::find(strKey, pixmap)) {
+ if (iter != qmlActivePixmapReplies()->end() && (*iter)->status() == QmlPixmapReply::Ready) {
+ // Must check this, since QPixmapCache::insert may have failed.
+ *pixmap = (*iter)->d_func()->pixmap;
+ status = (*iter)->status();
+ (*iter)->release();
+ } else if (QPixmapCache::find(strKey, pixmap)) {
if (iter != qmlActivePixmapReplies()->end()) {
status = (*iter)->status();
(*iter)->release();