diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-05-24 01:11:57 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-05-24 02:37:36 (GMT) |
commit | b933f40a39a000ee79e80564b529a3b72365cfae (patch) | |
tree | 1f10d6fade41c633844dfaba705c9eda46e67c56 /src/declarative/util | |
parent | 80f946828264c8e9e9213e0b8760f772090c979f (diff) | |
download | Qt-b933f40a39a000ee79e80564b529a3b72365cfae.zip Qt-b933f40a39a000ee79e80564b529a3b72365cfae.tar.gz Qt-b933f40a39a000ee79e80564b529a3b72365cfae.tar.bz2 |
Move copies of toLocalFileOrQrc() to QDeclarativeEnginePrivate
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qdeclarativefontloader.cpp | 12 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache.cpp | 12 |
2 files changed, 4 insertions, 20 deletions
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index adfcd62..c73f827 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -53,6 +53,7 @@ #include <QFontDatabase> #include <private/qobject_p.h> +#include <private/qdeclarativeengine_p.h> #include <qdeclarativeinfo.h> QT_BEGIN_NAMESPACE @@ -98,15 +99,6 @@ QDeclarativeFontLoader::~QDeclarativeFontLoader() { } -static QString toLocalFileOrQrc(const QUrl& url) -{ - QString r = url.toLocalFile(); - if (r.isEmpty() && url.scheme() == QLatin1String("qrc")) - r = QLatin1Char(':') + url.path(); - return r; -} - - /*! \qmlproperty url FontLoader::source The url of the font to load. @@ -127,7 +119,7 @@ void QDeclarativeFontLoader::setSource(const QUrl &url) d->status = Loading; emit statusChanged(); #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML - QString lf = toLocalFileOrQrc(d->url); + QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url); if (!lf.isEmpty()) { int id = QFontDatabase::addApplicationFont(lf); if (id != -1) { diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index d9ce42c..a4ddf46 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -66,14 +66,6 @@ static const int maxImageRequestCount = 8; QT_BEGIN_NAMESPACE -static QString toLocalFileOrQrc(const QUrl& url) -{ - QString r = url.toLocalFile(); - if (r.isEmpty() && url.scheme() == QLatin1String("qrc")) - r = QLatin1Char(':') + url.path(); - return r; -} - class QDeclarativeImageReaderEvent : public QEvent { public: @@ -269,7 +261,7 @@ bool QDeclarativeImageRequestHandler::event(QEvent *event) } QCoreApplication::postEvent(runningJob, new QDeclarativeImageReaderEvent(errorCode, errorStr, image)); } else { - QString lf = toLocalFileOrQrc(url); + QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); if (!lf.isEmpty()) { // Image is local - load/decode immediately QImage image; @@ -613,7 +605,7 @@ QDeclarativePixmapReply::Status QDeclarativePixmapCache::get(const QUrl& url, QP #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML if (!async) { - QString lf = toLocalFileOrQrc(url); + QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); if (!lf.isEmpty()) { status = QDeclarativePixmapReply::Ready; if (!QPixmapCache::find(strKey,pixmap)) { |