aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4compileddata_p.h5
-rw-r--r--src/qml/qml/qqmlcompiler_p.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 2f335958e6..30e7795bb3 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -37,9 +37,12 @@
#include <QVector>
#include <QStringList>
#include <QHash>
+#include <QUrl>
+
#include <private/qv4value_p.h>
#include <private/qv4executableallocator_p.h>
#include <private/qqmlrefcount_p.h>
+#include <private/qqmlnullablevalue_p_p.h>
QT_BEGIN_NAMESPACE
@@ -586,12 +589,14 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public QQmlRefCount
#ifndef V4_BOOTSTRAP
ExecutionEngine *engine;
QString fileName() const { return data->stringAt(data->sourceFileIndex); }
+ QUrl url() const { if (m_url.isNull) m_url = QUrl(fileName()); return m_url; }
QV4::Heap::String **runtimeStrings; // Array
QV4::Lookup *runtimeLookups;
QV4::Value *runtimeRegularExpressions;
QV4::InternalClass **runtimeClasses;
QVector<QV4::Function *> runtimeFunctions;
+ mutable QQmlNullableValue<QUrl> m_url;
QV4::Function *linkToEngine(QV4::ExecutionEngine *engine);
void unlink();
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h
index 5e76533739..3569a106c9 100644
--- a/src/qml/qml/qqmlcompiler_p.h
+++ b/src/qml/qml/qqmlcompiler_p.h
@@ -84,7 +84,7 @@ public:
QQmlEngine *engine;
QString fileName() const { return compilationUnit->fileName(); }
- QUrl url() const { return QUrl(fileName()); }
+ QUrl url() const { return compilationUnit->url(); }
QQmlTypeNameCache *importCache;
int metaTypeId;