Remove special case for var properties
authorFrank Meerkoetter <frank.meerkoetter@basyskom.com>
Fri, 7 Aug 2015 20:55:52 +0000 (22:55 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 18 Aug 2015 20:26:51 +0000 (20:26 +0000)
In the new world order all the properties are QV4::Values. Therefore
this special handling can be removed.

Change-Id: Ia4d703256db7330936cd16a835d16d140adfe20e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/qml/qml/qqmlvmemetaobject.cpp
src/qml/qml/qqmlvmemetaobject_p.h

index c7993e6ec7bcad3a1738e1fe72cfcdf1c9bfe6fd..89e8792b9fee951d1927c33421078310ab4c9815 100644 (file)
@@ -52,8 +52,8 @@
 
 QT_BEGIN_NAMESPACE
 
-QQmlVMEVariantQObjectPtr::QQmlVMEVariantQObjectPtr(bool isVar)
-    : QQmlGuard<QObject>(0), m_target(0), m_isVar(isVar), m_index(-1)
+QQmlVMEVariantQObjectPtr::QQmlVMEVariantQObjectPtr()
+    : QQmlGuard<QObject>(0), m_target(0), m_index(-1)
 {
 }
 
@@ -64,8 +64,7 @@ QQmlVMEVariantQObjectPtr::~QQmlVMEVariantQObjectPtr()
 void QQmlVMEVariantQObjectPtr::objectDestroyed(QObject *)
 {
     if (m_target && m_index >= 0) {
-        // Set the var property to NULL
-        if (m_isVar && m_target->propertiesInitialized && !m_target->properties.isUndefined()) {
+        if (m_target->propertiesInitialized && !m_target->properties.isUndefined()) {
             QV4::ExecutionEngine *v4 = m_target->properties.engine();
             if (v4) {
                 QV4::Scope scope(v4);
@@ -303,7 +302,7 @@ void QQmlVMEMetaObject::writeProperty(int id, QObject* v)
 
     QQmlVMEVariantQObjectPtr *guard = getQObjectGuardForProperty(id);
     if (v && !guard) {
-        guard = new QQmlVMEVariantQObjectPtr(true);
+        guard = new QQmlVMEVariantQObjectPtr();
         varObjectGuards.append(guard);
     }
     if (guard)
@@ -916,7 +915,7 @@ void QQmlVMEMetaObject::writeVarProperty(int id, const QV4::Value &value)
 
         // Do we already have a QObject guard for this property?
         if (valueObject && !guard) {
-            guard = new QQmlVMEVariantQObjectPtr(true);
+            guard = new QQmlVMEVariantQObjectPtr();
             varObjectGuards.append(guard);
         }
     }
index 5f688fe2e79c3a2dd22627aeea3356ca17b46bdb..5d4d7055a143e2b28502ef9de2dd9481ae7cc9c2 100644 (file)
@@ -136,15 +136,14 @@ class QQmlVMEMetaObject;
 class QQmlVMEVariantQObjectPtr : public QQmlGuard<QObject>
 {
 public:
-    inline QQmlVMEVariantQObjectPtr(bool isVar);
+    inline QQmlVMEVariantQObjectPtr();
     inline ~QQmlVMEVariantQObjectPtr();
 
     inline void objectDestroyed(QObject *);
     inline void setGuardedValue(QObject *obj, QQmlVMEMetaObject *target, int index);
 
     QQmlVMEMetaObject *m_target;
-    unsigned m_isVar : 1; // TODO: remove?
-    int m_index : 31;
+    int m_index;
 };
 
 class QQmlVMEVariant;