diff options
author | Alan Alpert <aalpert@rim.com> | 2013-02-28 17:03:43 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-07 19:41:26 +0200 |
commit | 223313479bf8ec80158ba0f6cba4dd5e74d92718 (patch) | |
tree | bc39fb195736657dec6a09106ad9609253074d77 /src/qml/qml/qqmlcompiler.cpp | |
parent | 40d90b50c555a968f1ae540527199042fbcf1a32 (diff) |
Add a URL interceptor to the QML engine
Allows for custom file handling to a greater extent than the
QNetworkAccessManager.
Change-Id: Ifd3946bf33530c40ca2edeeb9f441f712e4941f6
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Diffstat (limited to 'src/qml/qml/qqmlcompiler.cpp')
-rw-r--r-- | src/qml/qml/qqmlcompiler.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp index 6951c8c387..7b27a4c314 100644 --- a/src/qml/qml/qqmlcompiler.cpp +++ b/src/qml/qml/qqmlcompiler.cpp @@ -60,6 +60,7 @@ #include "qqmlscriptstring.h" #include "qqmlglobal_p.h" #include "qqmlbinding_p.h" +#include "qqmlabstracturlinterceptor_p.h" #include <private/qv4compiler_p.h> #include <QDebug> @@ -517,6 +518,10 @@ void QQmlCompiler::genLiteralAssignment(QQmlScript::Property *prop, // Encoded dir-separators defeat QUrl processing - decode them first string.replace(QLatin1String("%2f"), QLatin1String("/"), Qt::CaseInsensitive); QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string)); + // Apply URL interceptor + if (engine->urlInterceptor()) + u = engine->urlInterceptor()->intercept(u, + QQmlAbstractUrlInterceptor::UrlString); instr.propertyIndex = prop->index; instr.value = output->indexForUrl(u); output->addInstruction(instr); |