diff options
Diffstat (limited to 'src/declarative/util/qdeclarativepixmapcache.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index 1177d07..de2de21 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -956,20 +956,20 @@ QRect QDeclarativePixmap::rect() const void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url) { - load(engine, url, QSize(), QDeclarativePixmap::Cached); + load(engine, url, QSize(), false); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, QDeclarativePixmap::Options options) +void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, bool async) { - load(engine, url, QSize(), options); + load(engine, url, QSize(), async); } void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &size) { - load(engine, url, size, QDeclarativePixmap::Cached); + load(engine, url, size, false); } -void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, QDeclarativePixmap::Options options) +void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QSize &requestSize, bool async) { if (d) { d->release(); d = 0; } @@ -979,20 +979,19 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QHash<QDeclarativePixmapKey, QDeclarativePixmapData *>::Iterator iter = store->m_cache.find(key); if (iter == store->m_cache.end()) { - if (options & QDeclarativePixmap::Asynchronous) { + if (async) { // pixmaps can only be loaded synchronously if (url.scheme() == QLatin1String("image") && QDeclarativeEnginePrivate::get(engine)->getImageProviderType(url) == QDeclarativeImageProvider::Pixmap) { - options &= ~QDeclarativePixmap::Asynchronous; + async = false; } } - if (!(options & QDeclarativePixmap::Asynchronous)) { + if (!async) { bool ok = false; d = createPixmapDataSync(engine, url, requestSize, &ok); if (ok) { - if (options & QDeclarativePixmap::Cached) - d->addToCache(); + d->addToCache(); return; } if (d) // loadable, but encountered error while loading @@ -1005,8 +1004,7 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const QDeclarativePixmapReader *reader = QDeclarativePixmapReader::instance(engine); d = new QDeclarativePixmapData(url, requestSize); - if (options & QDeclarativePixmap::Cached) - d->addToCache(); + d->addToCache(); d->reply = reader->getImage(d); } else { |