summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeinclude.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-05-24 01:11:57 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-05-24 02:37:36 (GMT)
commitb933f40a39a000ee79e80564b529a3b72365cfae (patch)
tree1f10d6fade41c633844dfaba705c9eda46e67c56 /src/declarative/qml/qdeclarativeinclude.cpp
parent80f946828264c8e9e9213e0b8760f772090c979f (diff)
downloadQt-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.cpp14
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())