diff options
author | Lars Knoll <[email protected]> | 2014-04-29 10:57:23 +0200 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2014-07-22 13:49:03 +0200 |
commit | 06ad87eb0f8abde691026b9a72d372184d6d8249 (patch) | |
tree | 7536278f8f9e00cd662ede99b52e4810a4127428 /src/qml | |
parent | 3da391808eaa8b64e7e700965ce488d8b41e1705 (diff) |
Convert DateObject over to new storage scheme
Change-Id: I34b391a79ef80ab09e892b9a00897b90b31802ef
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4dateobject_p.h | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 5018dddaaa..61261d6b8a 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -647,7 +647,7 @@ DateObject::DateObject(ExecutionEngine *engine, const QDateTime &date) : Object(engine->dateClass) { setVTable(staticVTable()); - data.value.setDouble(date.isValid() ? date.toMSecsSinceEpoch() : qSNaN()); + d()->value.setDouble(date.isValid() ? date.toMSecsSinceEpoch() : qSNaN()); } QDateTime DateObject::toQDateTime() const diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h index 01d4ba88ea..a60f503915 100644 --- a/src/qml/jsruntime/qv4dateobject_p.h +++ b/src/qml/jsruntime/qv4dateobject_p.h @@ -52,17 +52,19 @@ class QDateTime; namespace QV4 { struct DateObject: Object { - V4_OBJECT - Q_MANAGED_TYPE(DateObject) - - struct Data { + struct Data : Object::Data { Value value; }; - Data data; + struct { + Value value; + } __data; + V4_OBJECT_NEW + Q_MANAGED_TYPE(DateObject) + - Value date() const { return data.value; } - Value &date() { return data.value; } - void setDate(const ValueRef d) { data.value = d; } + Value date() const { return d()->value; } + Value &date() { return d()->value; } + void setDate(const ValueRef date) { d()->value = date; } DateObject(ExecutionEngine *engine, const ValueRef date) : Object(engine->dateClass) @@ -76,13 +78,13 @@ struct DateObject: Object { protected: DateObject(InternalClass *ic): Object(ic) { Q_ASSERT(internalClass()->vtable == staticVTable()); - data.value = Primitive::fromDouble(qSNaN()); + d()->value = Primitive::fromDouble(qSNaN()); } }; struct DateCtor: FunctionObject { - V4_OBJECT + V4_OBJECT_NEW DateCtor(ExecutionContext *scope); static ReturnedValue construct(Managed *, CallData *callData); |