diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-03 16:29:16 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-06-03 20:39:04 +0200 |
commit | 94946e6fb412a34f1d0bd3bb550a8ff195976ee6 (patch) | |
tree | 3644287597da1bb0a246552c8fee82b34f01ac6b /src/qml/qml/v8/qv8qobjectwrapper_p.h | |
parent | a336ca4cc35fdcabedf4ff2614cc6d6625e7d4ef (diff) |
Fix regression with meta object revision checking
Commit 00a07bcbd7a592072822b0e55ab2e75e90c3f9f5 replaced the CheckRevision
parameter on the call GetProperty on the scope QObject with a get that
would do IgnoreRevision.
This adds a property getter on the QV4::QObjectWrapper that allows for checking
the meta object revision. The plan is to move all of the property getter code
from QV8QObjectWrapper into QV4::QObjectWrapper incrementally.
Change-Id: I8e5a93ce3351a8c5dba13f14cd43e4036875b792
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qv8qobjectwrapper_p.h')
-rw-r--r-- | src/qml/qml/v8/qv8qobjectwrapper_p.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/qml/qml/v8/qv8qobjectwrapper_p.h b/src/qml/qml/v8/qv8qobjectwrapper_p.h index b88b3cea99..f8d128fc57 100644 --- a/src/qml/qml/v8/qv8qobjectwrapper_p.h +++ b/src/qml/qml/v8/qv8qobjectwrapper_p.h @@ -83,7 +83,9 @@ struct Q_QML_EXPORT QObjectWrapper : public QV4::Object { Q_MANAGED - QObjectWrapper(ExecutionEngine *v8Engine, QObject *m_object); + enum RevisionMode { IgnoreRevision, CheckRevision }; + + QObjectWrapper(ExecutionEngine *v8Engine, QObject *object); ~QObjectWrapper(); QV8Engine *v8Engine; // ### Remove again. @@ -92,6 +94,8 @@ struct Q_QML_EXPORT QObjectWrapper : public QV4::Object void deleteQObject(bool deleteInstantly = false); + Value getProperty(ExecutionContext *ctx, String *name, RevisionMode revisionMode, bool *hasProperty = 0); + private: QQmlGuard<QObject> m_object; String *m_destroy; @@ -170,9 +174,8 @@ public: v8::Handle<v8::Value> newQObject(QObject *object); - enum RevisionMode { IgnoreRevision, CheckRevision }; - inline v8::Handle<v8::Value> getProperty(QObject *, const QHashedV4String &, QQmlContextData *, RevisionMode); - inline bool setProperty(QObject *, const QHashedV4String &, QQmlContextData *, v8::Handle<v8::Value>, RevisionMode); + inline v8::Handle<v8::Value> getProperty(QObject *, const QHashedV4String &, QQmlContextData *, QV4::QObjectWrapper::RevisionMode); + inline bool setProperty(QObject *, const QHashedV4String &, QQmlContextData *, v8::Handle<v8::Value>, QV4::QObjectWrapper::RevisionMode); private: friend class QQmlPropertyCache; @@ -182,9 +185,9 @@ private: v8::Handle<v8::Object> newQObject(QObject *, QQmlData *, QV8Engine *); static QV4::Value GetProperty(QV8Engine *, QObject *, - const QHashedV4String &, QQmlContextData *, QV8QObjectWrapper::RevisionMode); + const QHashedV4String &, QQmlContextData *, QV4::QObjectWrapper::RevisionMode); static bool SetProperty(QV8Engine *, QObject *, const QHashedV4String &, QQmlContextData *, - v8::Handle<v8::Value>, QV8QObjectWrapper::RevisionMode); + v8::Handle<v8::Value>, QV4::QObjectWrapper::RevisionMode); static QV4::Value Connect(QV4::SimpleCallContext *ctx); static QV4::Value Disconnect(QV4::SimpleCallContext *ctx); static QPair<QObject *, int> ExtractQtMethod(QV8Engine *, QV4::FunctionObject *); @@ -198,7 +201,7 @@ private: }; v8::Handle<v8::Value> QV8QObjectWrapper::getProperty(QObject *object, const QHashedV4String &string, - QQmlContextData *context, RevisionMode mode) + QQmlContextData *context, QV4::QObjectWrapper::RevisionMode mode) { QQmlData *dd = QQmlData::get(object, false); if (!dd || !dd->propertyCache || @@ -210,7 +213,7 @@ v8::Handle<v8::Value> QV8QObjectWrapper::getProperty(QObject *object, const QHas } bool QV8QObjectWrapper::setProperty(QObject *object, const QHashedV4String &string, - QQmlContextData *context, v8::Handle<v8::Value> value, RevisionMode mode) + QQmlContextData *context, v8::Handle<v8::Value> value, QV4::QObjectWrapper::RevisionMode mode) { QQmlData *dd = QQmlData::get(object, false); if (!dd || !dd->propertyCache || |