aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlcontext.cpp')
-rw-r--r--src/qml/qml/qqmlcontext.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index efe586eec1..daa115b952 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -48,6 +48,7 @@
#include "qqmlengine_p.h"
#include "qqmlengine.h"
#include "qqmlinfo.h"
+#include "qqmlabstracturlinterceptor_p.h"
#include <qjsengine.h>
#include <QtCore/qvarlengtharray.h>
@@ -429,6 +430,7 @@ QUrl QQmlContextData::resolvedUrl(const QUrl &src)
{
QQmlContextData *ctxt = this;
+ QUrl resolved;
if (src.isRelative() && !src.isEmpty()) {
if (ctxt) {
while(ctxt) {
@@ -439,14 +441,20 @@ QUrl QQmlContextData::resolvedUrl(const QUrl &src)
}
if (ctxt)
- return ctxt->url.resolved(src);
+ resolved = ctxt->url.resolved(src);
else if (engine)
- return engine->baseUrl().resolved(src);
+ resolved = engine->baseUrl().resolved(src);
}
- return QUrl();
} else {
- return src;
+ resolved = src;
}
+
+ if (resolved.isEmpty()) //relative but no ctxt
+ return resolved;
+
+ if (engine && engine->urlInterceptor())
+ resolved = engine->urlInterceptor()->intercept(resolved, QQmlAbstractUrlInterceptor::UrlString);
+ return resolved;
}