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/qml/qdeclarativeinclude.cpp | |
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/qml/qdeclarativeinclude.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeinclude.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp index 4cde54b..388f252 100644 --- a/src/declarative/qml/qdeclarativeinclude.cpp +++ b/src/declarative/qml/qdeclarativeinclude.cpp @@ -172,16 +172,6 @@ void QDeclarativeInclude::callback(QScriptEngine *engine, QScriptValue &callback } } -static QString toLocalFileOrQrc(const QUrl& url) -{ - if (url.scheme() == QLatin1String("qrc")) { - if (url.authority().isEmpty()) - return QLatin1Char(':') + url.path(); - return QString(); - } - return url.toLocalFile(); -} - QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *engine) { if (ctxt->argumentCount() == 0) @@ -200,7 +190,7 @@ QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *e urlString = url.toString(); } - QString localFile = toLocalFileOrQrc(url); + QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); QScriptValue func = ctxt->argument(1); if (!func.isFunction()) @@ -269,7 +259,7 @@ QScriptValue QDeclarativeInclude::worker_include(QScriptContext *ctxt, QScriptEn urlString = url.toString(); } - QString localFile = toLocalFileOrQrc(url); + QString localFile = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(url); QScriptValue func = ctxt->argument(1); if (!func.isFunction()) |