diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-16 01:28:14 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-16 01:28:14 (GMT) |
commit | fc399f2cd81772fed179d59a6f53abe69a81083a (patch) | |
tree | 3dc9885e18c8d37955e073d415c02ac1656e0f30 | |
parent | 7b0d764f37fa4009dc1556666eb8a141164fb0e0 (diff) | |
download | Qt-fc399f2cd81772fed179d59a6f53abe69a81083a.zip Qt-fc399f2cd81772fed179d59a6f53abe69a81083a.tar.gz Qt-fc399f2cd81772fed179d59a6f53abe69a81083a.tar.bz2 |
Correctly support translation in QDeclarativePixmapCache
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache.cpp | 10 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache_p.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index 893fbf3..dbca326 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -194,7 +194,7 @@ static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *e return true; } else { if (errorString) - *errorString = QDeclarativeImageRequestHandler::tr("Error decoding: %1: %2").arg(url.toString()) + *errorString = QDeclarativePixmapCache::tr("Error decoding: %1: %2").arg(url.toString()) .arg(imgio.errorString()); return false; } @@ -264,7 +264,7 @@ bool QDeclarativeImageRequestHandler::event(QEvent *event) QString errorStr; if (image.isNull()) { errorCode = QDeclarativeImageReaderEvent::Loading; - errorStr = QDeclarativeImageRequestHandler::tr("Failed to get image from provider: %1").arg(url.toString()); + errorStr = QDeclarativePixmapCache::tr("Failed to get image from provider: %1").arg(url.toString()); } QCoreApplication::postEvent(runningJob, new QDeclarativeImageReaderEvent(errorCode, errorStr, image)); } else { @@ -283,7 +283,7 @@ bool QDeclarativeImageRequestHandler::event(QEvent *event) errorCode = QDeclarativeImageReaderEvent::Loading; } } else { - errorStr = QDeclarativeImageRequestHandler::tr("Cannot open: %1").arg(url.toString()); + errorStr = QDeclarativePixmapCache::tr("Cannot open: %1").arg(url.toString()); errorCode = QDeclarativeImageReaderEvent::Loading; } QCoreApplication::postEvent(runningJob, new QDeclarativeImageReaderEvent(errorCode, errorStr, image)); @@ -625,7 +625,7 @@ QDeclarativePixmapReply::Status QDeclarativePixmapCache::get(const QUrl& url, QP } } else { if (errorString) - *errorString = QDeclarativeImageRequestHandler::tr("Cannot open: %1").arg(url.toString()); + *errorString = tr("Cannot open: %1").arg(url.toString()); *pixmap = QPixmap(); status = QDeclarativePixmapReply::Error; } @@ -662,7 +662,7 @@ QDeclarativePixmapReply::Status QDeclarativePixmapCache::get(const QUrl& url, QP } else if (pixmap->isNull()) { status = QDeclarativePixmapReply::Error; if (errorString) - *errorString = QDeclarativeImageRequestHandler::tr("Unknown Error loading %1").arg(url.toString()); + *errorString = tr("Unknown Error loading %1").arg(url.toString()); } else { status = QDeclarativePixmapReply::Ready; } diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h index 7b94728..33d9de1 100644 --- a/src/declarative/util/qdeclarativepixmapcache_p.h +++ b/src/declarative/util/qdeclarativepixmapcache_p.h @@ -45,6 +45,7 @@ #include <QtCore/QString> #include <QtGui/QPixmap> #include <QtCore/qurl.h> +#include <QtCore/QCoreApplication> QT_BEGIN_HEADER @@ -95,6 +96,7 @@ private: class Q_DECLARATIVE_EXPORT QDeclarativePixmapCache { + Q_DECLARE_TR_FUNCTIONS(QDeclarativePixmapCache) public: static QDeclarativePixmapReply::Status get(const QUrl& url, QPixmap *pixmap, QString *errorString, QSize *impsize=0, bool async=false, int req_width=0, int req_height=0); static QDeclarativePixmapReply *request(QDeclarativeEngine *, const QUrl& url, int req_width=0, int req_height=0); |