diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-15 08:57:33 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-16 19:05:57 +0000 |
commit | 4da7ca32bb271355ae3e707499a3f5627de069d4 (patch) | |
tree | 73d6398c6f9c9fd16279b9b0b905934e0ce78441 /src/qml/compiler/qqmltypecompiler_p.h | |
parent | f2c97b4e307a62b831f68a0278551d4375170336 (diff) |
Minor QQmlPropertyCacheCreator API cleanup
As part of removing the QQmlTypeCompiler dependency, the property cache
vector output of the creator is now passed explicitly as an out
parameter to the constructor.
Similarly the error handling is made explicit in the API instead of
implicitly passing any generated errors to the QQmlTypeCompiler.
Change-Id: Ia3013011518f59f57f2eecb526f64dec7d82cb91
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmltypecompiler_p.h')
-rw-r--r-- | src/qml/compiler/qqmltypecompiler_p.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h index 351c4f7294..29712e73e7 100644 --- a/src/qml/compiler/qqmltypecompiler_p.h +++ b/src/qml/compiler/qqmltypecompiler_p.h @@ -74,6 +74,17 @@ struct Location; } } +struct QQmlCompileError +{ + QQmlCompileError() {} + QQmlCompileError(const QV4::CompiledData::Location &location, const QString &description) + : location(location), description(description) {} + QV4::CompiledData::Location location; + QString description; + + bool isSet() const { return !description.isEmpty(); } +}; + struct QQmlTypeCompiler { Q_DECLARE_TR_FUNCTIONS(QQmlTypeCompiler) @@ -89,7 +100,9 @@ public: QV4::CompiledData::CompilationUnit *compile(); QList<QQmlError> compilationErrors() const { return errors; } - void recordError(const QQmlError &error); + void recordError(QQmlError error); + void recordError(const QV4::CompiledData::Location &location, const QString &description); + void recordError(const QQmlCompileError &error); int registerString(const QString &str); @@ -132,17 +145,6 @@ private: QQmlPropertyCacheVector m_propertyCaches; }; -struct QQmlCompileError -{ - QQmlCompileError() {} - QQmlCompileError(const QV4::CompiledData::Location &location, const QString &description) - : location(location), description(description) {} - QV4::CompiledData::Location location; - QString description; - - bool isSet() const { return !description.isEmpty(); } -}; - struct QQmlCompilePass { virtual ~QQmlCompilePass() {} @@ -151,9 +153,10 @@ struct QQmlCompilePass QString stringAt(int idx) const { return compiler->stringAt(idx); } protected: - void recordError(const QV4::CompiledData::Location &location, const QString &description) const; + void recordError(const QV4::CompiledData::Location &location, const QString &description) const + { compiler->recordError(location, description); } void recordError(const QQmlCompileError &error) - { recordError(error.location, error.description); } + { compiler->recordError(error); } QQmlTypeCompiler *compiler; }; |