diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-08-14 03:56:05 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-08-14 03:56:05 (GMT) |
commit | 56693f7d247ee8da6b730b157d1871a1dceab5a8 (patch) | |
tree | 20849a97cc14e8d178bc6383c91382c43c0fd87e /src/declarative/fx | |
parent | e84c2895ff108b43515a5200a646610efea6d8da (diff) | |
download | Qt-56693f7d247ee8da6b730b157d1871a1dceab5a8.zip Qt-56693f7d247ee8da6b730b157d1871a1dceab5a8.tar.gz Qt-56693f7d247ee8da6b730b157d1871a1dceab5a8.tar.bz2 |
QFxPixmap -> QFxPixmapCache
Diffstat (limited to 'src/declarative/fx')
-rw-r--r-- | src/declarative/fx/fx.pri | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxborderimage.cpp | 14 | ||||
-rw-r--r-- | src/declarative/fx/qfximagebase.cpp | 10 | ||||
-rw-r--r-- | src/declarative/fx/qfxpixmapcache.cpp (renamed from src/declarative/fx/qfxpixmap.cpp) | 14 | ||||
-rw-r--r-- | src/declarative/fx/qfxpixmapcache.h (renamed from src/declarative/fx/qfxpixmap.h) | 12 | ||||
-rw-r--r-- | src/declarative/fx/qfxscalegrid_p.h | 2 |
6 files changed, 27 insertions, 29 deletions
diff --git a/src/declarative/fx/fx.pri b/src/declarative/fx/fx.pri index 5f574cd..48af58e 100644 --- a/src/declarative/fx/fx.pri +++ b/src/declarative/fx/fx.pri @@ -41,7 +41,7 @@ HEADERS += \ fx/qfxtextedit_p.h \ fx/qfxtext.h \ fx/qfxtext_p.h \ - fx/qfxpixmap.cpp \ + fx/qfxpixmapcache.h \ fx/qfxvisualitemmodel.h \ fx/qfxlistview.h \ fx/qfxgraphicsobjectcontainer.h \ @@ -72,7 +72,7 @@ SOURCES += \ fx/qfxlineedit.cpp \ fx/qfxtext.cpp \ fx/qfxtextedit.cpp \ - fx/qfxpixmap.cpp \ + fx/qfxpixmapcache.cpp \ fx/qfxvisualitemmodel.cpp \ fx/qfxlistview.cpp \ fx/qfxgraphicsobjectcontainer.cpp \ diff --git a/src/declarative/fx/qfxborderimage.cpp b/src/declarative/fx/qfxborderimage.cpp index adb70a3..4920bf6 100644 --- a/src/declarative/fx/qfxborderimage.cpp +++ b/src/declarative/fx/qfxborderimage.cpp @@ -92,7 +92,7 @@ QFxBorderImage::~QFxBorderImage() if (d->sciReply) d->sciReply->deleteLater(); if (!d->sciurl.isEmpty()) - QFxPixmap::cancelGet(d->sciurl, this); + QFxPixmapCache::cancelGet(d->sciurl, this); } /*! \qmlproperty enum BorderImage::status @@ -166,9 +166,9 @@ void QFxBorderImage::setSource(const QUrl &url) } if (!d->url.isEmpty()) - QFxPixmap::cancelGet(d->url, this); + QFxPixmapCache::cancelGet(d->url, this); if (!d->sciurl.isEmpty()) - QFxPixmap::cancelGet(d->sciurl, this); + QFxPixmapCache::cancelGet(d->sciurl, this); d->url = url; d->sciurl = QUrl(); @@ -205,7 +205,7 @@ void QFxBorderImage::setSource(const QUrl &url) this, SLOT(sciRequestFinished())); } } else { - d->reply = QFxPixmap::get(qmlEngine(this), d->url, &d->pix); + d->reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->pix); if (d->reply) { connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished())); connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)), @@ -315,7 +315,7 @@ void QFxBorderImage::setGridScaledImage(const QFxGridScaledImage& sci) d->verticalTileMode = sci.verticalTileRule(); d->sciurl = d->url.resolved(QUrl(sci.pixmapUrl())); - d->reply = QFxPixmap::get(qmlEngine(this), d->sciurl, &d->pix); + d->reply = QFxPixmapCache::get(qmlEngine(this), d->sciurl, &d->pix); if (d->reply) { connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished())); connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)), @@ -340,7 +340,7 @@ void QFxBorderImage::requestFinished() { Q_D(QFxBorderImage); if (d->url.path().endsWith(QLatin1String(".sci"))) { - QFxPixmap::find(d->sciurl, &d->pix); + QFxPixmapCache::find(d->sciurl, &d->pix); } else { if (d->reply) { //###disconnect really needed? @@ -349,7 +349,7 @@ void QFxBorderImage::requestFinished() if (d->reply->error() != QNetworkReply::NoError) d->status = Error; } - QFxPixmap::find(d->url, &d->pix); + QFxPixmapCache::find(d->url, &d->pix); } setImplicitWidth(d->pix.width()); setImplicitHeight(d->pix.height()); diff --git a/src/declarative/fx/qfximagebase.cpp b/src/declarative/fx/qfximagebase.cpp index f96ff6f..66685c2 100644 --- a/src/declarative/fx/qfximagebase.cpp +++ b/src/declarative/fx/qfximagebase.cpp @@ -45,7 +45,7 @@ #include <QNetworkReply> #include <QFile> #include <QtDeclarative/qmlengine.h> -#include <QtDeclarative/qfxpixmap.h> +#include <QtDeclarative/qfxpixmapcache.h> QT_BEGIN_NAMESPACE @@ -65,7 +65,7 @@ QFxImageBase::~QFxImageBase() { Q_D(QFxImageBase); if (!d->url.isEmpty()) - QFxPixmap::cancelGet(d->url, this); + QFxPixmapCache::cancelGet(d->url, this); } QFxImageBase::Status QFxImageBase::status() const @@ -103,7 +103,7 @@ void QFxImageBase::setSource(const QUrl &url) return; if (!d->url.isEmpty()) - QFxPixmap::cancelGet(d->url, this); + QFxPixmapCache::cancelGet(d->url, this); d->url = url; if (d->progress != 0.0) { @@ -123,7 +123,7 @@ void QFxImageBase::setSource(const QUrl &url) update(); } else { d->status = Loading; - d->reply = QFxPixmap::get(qmlEngine(this), d->url, &d->pix); + d->reply = QFxPixmapCache::get(qmlEngine(this), d->url, &d->pix); if (d->reply) { connect(d->reply, SIGNAL(finished()), this, SLOT(requestFinished())); connect(d->reply, SIGNAL(downloadProgress(qint64,qint64)), @@ -156,7 +156,7 @@ void QFxImageBase::requestFinished() if (d->reply->error() != QNetworkReply::NoError) d->status = Error; } - QFxPixmap::find(d->url, &d->pix); + QFxPixmapCache::find(d->url, &d->pix); setImplicitWidth(d->pix.width()); setImplicitHeight(d->pix.height()); diff --git a/src/declarative/fx/qfxpixmap.cpp b/src/declarative/fx/qfxpixmapcache.cpp index 43e94e5..5220d15 100644 --- a/src/declarative/fx/qfxpixmap.cpp +++ b/src/declarative/fx/qfxpixmapcache.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qfxpixmap.h" +#include "qfxpixmapcache.h" #include <QImageReader> #include <QHash> #include <QNetworkReply> @@ -116,16 +116,14 @@ static bool readImage(QIODevice *dev, QPixmap *pixmap) /*! \internal - \class QFxPixmap - \ingroup group_utility + \class QFxPixmapCache \brief Enacapsultes a pixmap for QFx items. This class is NOT reentrant. - The pixmap cache will grow indefinately. */ -bool QFxPixmap::find(const QUrl& url, QPixmap *pixmap) +bool QFxPixmapCache::find(const QUrl& url, QPixmap *pixmap) { #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer<QFxPerf::PixmapLoad> perf; @@ -149,7 +147,7 @@ bool QFxPixmap::find(const QUrl& url, QPixmap *pixmap) QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key); if (iter == qfxActiveNetworkReplies.end()) { // API usage error - qWarning() << "QFxPixmap: URL not loaded" << url; + qWarning() << "QFxPixmapCache: URL not loaded" << url; } else { if ((*iter)->reply->error()) { qWarning() << "Network error loading" << url << (*iter)->reply->errorString(); @@ -175,7 +173,7 @@ bool QFxPixmap::find(const QUrl& url, QPixmap *pixmap) Returns a QNetworkReply if the image is not immediately available, otherwise returns 0. The QNetworkReply must not be stored - it may be destroyed at any time. */ -QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QPixmap *pixmap) +QNetworkReply *QFxPixmapCache::get(QmlEngine *engine, const QUrl& url, QPixmap *pixmap) { #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML if (url.scheme()==QLatin1String("file")) { @@ -220,7 +218,7 @@ QNetworkReply *QFxPixmap::get(QmlEngine *engine, const QUrl& url, QPixmap *pixma Any connections to the QNetworkReply returned by get() will be disconnected. */ -void QFxPixmap::cancelGet(const QUrl& url, QObject* obj) +void QFxPixmapCache::cancelGet(const QUrl& url, QObject* obj) { QString key = url.toString(); QFxSharedNetworkReplyHash::Iterator iter = qfxActiveNetworkReplies.find(key); diff --git a/src/declarative/fx/qfxpixmap.h b/src/declarative/fx/qfxpixmapcache.h index ec8d2be..ca5d47b 100644 --- a/src/declarative/fx/qfxpixmap.h +++ b/src/declarative/fx/qfxpixmapcache.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QFXPIXMAP_H -#define QFXPIXMAP_H +#ifndef QFXPIXMAPCACHE_H +#define QFXPIXMAPCACHE_H #include <QtCore/QString> #include <QtGui/QPixmap> @@ -54,17 +54,17 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QmlEngine; class QNetworkReply; -class Q_DECLARATIVE_EXPORT QFxPixmap //### rename QFxPixmapCache +class Q_DECLARATIVE_EXPORT QFxPixmapCache { public: static QNetworkReply *get(QmlEngine *, const QUrl& url, QPixmap *pixmap); static void cancelGet(const QUrl& url, QObject* obj); - static bool find(const QUrl& url, QPixmap *pixmap); // url must have been passed to QFxPixmap::get, and finished. Or must be a local file. + static bool find(const QUrl& url, QPixmap *pixmap); // url must have been passed to QFxPixmapCache::get, and finished. Or must be a local file. }; - QT_END_NAMESPACE QT_END_HEADER -#endif // QFXPIXMAP_H + +#endif // QFXPIXMAPCACHE_H diff --git a/src/declarative/fx/qfxscalegrid_p.h b/src/declarative/fx/qfxscalegrid_p.h index 7df90f1..bae1436 100644 --- a/src/declarative/fx/qfxscalegrid_p.h +++ b/src/declarative/fx/qfxscalegrid_p.h @@ -45,7 +45,7 @@ #include <QtCore/QString> #include <QtCore/QObject> #include <QtDeclarative/qfxglobal.h> -#include <QtDeclarative/qfxpixmap.h> +#include <QtDeclarative/qfxpixmapcache.h> #include <QtDeclarative/qml.h> #include "qfxborderimage.h" |