diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-05-04 11:55:00 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-27 02:29:48 +0200 |
commit | 17910705ee02744edc968f7bc7de2a2d652483dd (patch) | |
tree | e99f02b1813bdffc0c3df062b6d915325a73359e /src/qml/qml/v4 | |
parent | a93c2608d69fa385c675a6b49e4d4bfb97f83ed2 (diff) |
Consistent use of syntax in V4 Register class
Use the construction/destruction wrapper functions consistently.
These are required for template types because the syntax to invoke
the destructor directly confuses GCC.
Change-Id: I4a6c9239972a96f84a601b4f4a8aeebfd75044a9
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/v4')
-rw-r--r-- | src/qml/qml/v4/qv4bindings.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/qml/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp index 7d42b47d53..f011bc8f26 100644 --- a/src/qml/qml/v4/qv4bindings.cpp +++ b/src/qml/qml/v4/qv4bindings.cpp @@ -188,17 +188,17 @@ void Register::cleanup() { if (dataType >= FirstCleanupType) { if (dataType == QStringType) { - getstringptr()->~QString(); + destroyPointee(getstringptr()); } else if (dataType == QUrlType) { - geturlptr()->~QUrl(); + destroyPointee(geturlptr()); } else if (dataType == QColorType) { QQml_valueTypeProvider()->destroyValueType(QMetaType::QColor, typeDataPtr(), dataSize()); } else if (dataType == QVariantType) { - getvariantptr()->~QVariant(); + destroyPointee(getvariantptr()); } else if (dataType == qMetaTypeId<v8::Handle<v8::Value> >()) { destroyPointee(gethandleptr()); } else if (dataType == qMetaTypeId<QJSValue>()) { - getjsvalueptr()->~QJSValue(); + destroyPointee(getjsvalueptr()); } } setUndefined(); @@ -206,13 +206,13 @@ void Register::cleanup() void Register::cleanupString() { - getstringptr()->~QString(); + destroyPointee(getstringptr()); setUndefined(); } void Register::cleanupUrl() { - geturlptr()->~QUrl(); + destroyPointee(geturlptr()); setUndefined(); } @@ -224,7 +224,7 @@ void Register::cleanupColor() void Register::cleanupVariant() { - getvariantptr()->~QVariant(); + destroyPointee(getvariantptr()); setUndefined(); } @@ -236,7 +236,7 @@ void Register::cleanupHandle() void Register::cleanupJSValue() { - getjsvalueptr()->~QJSValue(); + destroyPointee(getjsvalueptr()); setUndefined(); } @@ -245,17 +245,17 @@ void Register::copy(const Register &other) *this = other; if (other.dataType >= FirstCleanupType) { if (other.dataType == QStringType) - new (getstringptr()) QString(*other.getstringptr()); + copyConstructPointee(getstringptr(), other.getstringptr()); else if (other.dataType == QUrlType) - new (geturlptr()) QUrl(*other.geturlptr()); + copyConstructPointee(geturlptr(), other.geturlptr()); else if (other.dataType == QColorType) QQml_valueTypeProvider()->copyValueType(QMetaType::QColor, other.typeDataPtr(), typeDataPtr(), dataSize()); else if (other.dataType == QVariantType) - new (getvariantptr()) QVariant(*other.getvariantptr()); + copyConstructPointee(getvariantptr(), other.getvariantptr()); else if (other.dataType == qMetaTypeId<v8::Handle<v8::Value> >()) copyConstructPointee(gethandleptr(), other.gethandleptr()); else if (other.dataType == qMetaTypeId<QJSValue>()) - new (getjsvalueptr()) QJSValue(*other.getjsvalueptr()); + copyConstructPointee(getjsvalueptr(), other.getjsvalueptr()); } } @@ -264,17 +264,17 @@ void Register::init(Type type) dataType = type; if (dataType >= FirstCleanupType) { if (dataType == QStringType) - new (getstringptr()) QString(); + defaultConstructPointee(getstringptr()); else if (dataType == QUrlType) - new (geturlptr()) QUrl(); + defaultConstructPointee(geturlptr()); else if (dataType == QColorType) QQml_valueTypeProvider()->initValueType(QMetaType::QColor, typeDataPtr(), dataSize()); else if (dataType == QVariantType) - new (getvariantptr()) QVariant(); + defaultConstructPointee(getvariantptr()); else if (dataType == qMetaTypeId<v8::Handle<v8::Value> >()) defaultConstructPointee(gethandleptr()); else if (dataType == qMetaTypeId<QJSValue>()) - new (getjsvalueptr()) QJSValue(); + defaultConstructPointee(getjsvalueptr()); } } |