Get rid of QQmlAbstractExpression
authorLars Knoll <lars.knoll@theqtcompany.com>
Mon, 13 Apr 2015 08:29:45 +0000 (10:29 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Fri, 24 Apr 2015 19:57:32 +0000 (19:57 +0000)
The class is always used together with QQmlJavaScriptExpression,
so we can just as well fold the functionality together into one
class and simplify our code.

Change-Id: I23820e51efaaea16ae5db7e2153a827d7b22999e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
14 files changed:
src/qml/qml/qml.pri
src/qml/qml/qqmlabstractexpression.cpp [deleted file]
src/qml/qml/qqmlabstractexpression_p.h [deleted file]
src/qml/qml/qqmlbinding.cpp
src/qml/qml/qqmlbinding_p.h
src/qml/qml/qqmlboundsignal_p.h
src/qml/qml/qqmlcontext.cpp
src/qml/qml/qqmlcontext_p.h
src/qml/qml/qqmlexpression.cpp
src/qml/qml/qqmlexpression_p.h
src/qml/qml/qqmljavascriptexpression.cpp
src/qml/qml/qqmljavascriptexpression_p.h
src/qml/qml/qqmlproperty_p.h
tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp

index e733bce..10ae9f0 100644 (file)
@@ -35,7 +35,6 @@ SOURCES += \
     $$PWD/qqmlimport.cpp \
     $$PWD/qqmllist.cpp \
     $$PWD/qqmllocale.cpp \
-    $$PWD/qqmlabstractexpression.cpp \
     $$PWD/qqmljavascriptexpression.cpp \
     $$PWD/qqmlabstractbinding.cpp \
     $$PWD/qqmlvaluetypeproxybinding.cpp \
@@ -107,7 +106,6 @@ HEADERS += \
     $$PWD/qqmlscriptstring_p.h \
     $$PWD/qqmllocale_p.h \
     $$PWD/qqmlcomponentattached_p.h \
-    $$PWD/qqmlabstractexpression_p.h \
     $$PWD/qqmljavascriptexpression_p.h \
     $$PWD/qqmlabstractbinding_p.h \
     $$PWD/qqmlvaluetypeproxybinding_p.h \
diff --git a/src/qml/qml/qqmlabstractexpression.cpp b/src/qml/qml/qqmlabstractexpression.cpp
deleted file mode 100644 (file)
index c55c869..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL21$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qqmlabstractexpression_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QQmlAbstractExpression::QQmlAbstractExpression()
-: m_prevExpression(0), m_nextExpression(0)
-{
-}
-
-QQmlAbstractExpression::~QQmlAbstractExpression()
-{
-    if (m_prevExpression) {
-        *m_prevExpression = m_nextExpression;
-        if (m_nextExpression)
-            m_nextExpression->m_prevExpression = m_prevExpression;
-    }
-
-    if (m_context.isT2())
-        m_context.asT2()->_s = 0;
-}
-
-QQmlContextData *QQmlAbstractExpression::context() const
-{
-    if (m_context.isT1()) return m_context.asT1();
-    else return m_context.asT2()->_c;
-}
-
-void QQmlAbstractExpression::setContext(QQmlContextData *context)
-{
-    if (m_prevExpression) {
-        *m_prevExpression = m_nextExpression;
-        if (m_nextExpression)
-            m_nextExpression->m_prevExpression = m_prevExpression;
-        m_prevExpression = 0;
-        m_nextExpression = 0;
-    }
-
-    if (m_context.isT1()) m_context = context;
-    else m_context.asT2()->_c = context;
-
-    if (context) {
-        m_nextExpression = context->expressions;
-        if (m_nextExpression)
-            m_nextExpression->m_prevExpression = &m_nextExpression;
-        m_prevExpression = &context->expressions;
-        context->expressions = this;
-    }
-}
-
-void QQmlAbstractExpression::refresh()
-{
-}
-
-bool QQmlAbstractExpression::isValid() const
-{
-    return context() != 0;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/qml/qml/qqmlabstractexpression_p.h b/src/qml/qml/qqmlabstractexpression_p.h
deleted file mode 100644 (file)
index 82ba010..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL21$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQMLABSTRACTEXPRESSION_P_H
-#define QQMLABSTRACTEXPRESSION_P_H
-
-//
-//  W A R N I N G
-//  -------------
-//
-// This file is not part of the Qt API.  It exists purely as an
-// implementation detail.  This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qqmlcontext_p.h>
-#include <private/qfieldlist_p.h>
-#include <private/qflagpointer_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_QML_PRIVATE_EXPORT QQmlAbstractExpression
-{
-public:
-    QQmlAbstractExpression();
-    virtual ~QQmlAbstractExpression();
-
-    bool isValid() const;
-
-    QQmlContextData *context() const;
-    void setContext(QQmlContextData *);
-
-    virtual void refresh();
-
-    class DeleteWatcher {
-    public:
-        inline DeleteWatcher(QQmlAbstractExpression *);
-        inline ~DeleteWatcher();
-        inline bool wasDeleted() const;
-    private:
-        friend class QQmlAbstractExpression;
-        QQmlContextData *_c;
-        QQmlAbstractExpression **_w;
-        QQmlAbstractExpression *_s;
-    };
-
-private:
-    friend class QQmlContext;
-    friend class QQmlContextData;
-    friend class QQmlContextPrivate;
-
-    QBiPointer<QQmlContextData, DeleteWatcher> m_context;
-    QQmlAbstractExpression **m_prevExpression;
-    QQmlAbstractExpression  *m_nextExpression;
-};
-
-QQmlAbstractExpression::DeleteWatcher::DeleteWatcher(QQmlAbstractExpression *e)
-: _c(0), _w(0), _s(e)
-{
-    if (e->m_context.isT1()) {
-        _w = &_s;
-        _c = e->m_context.asT1();
-        e->m_context = this;
-    } else {
-        // Another watcher is already registered
-        _w = &e->m_context.asT2()->_s;
-    }
-}
-
-QQmlAbstractExpression::DeleteWatcher::~DeleteWatcher()
-{
-    Q_ASSERT(*_w == 0 || (*_w == _s && _s->m_context.isT2()));
-    if (*_w && _s->m_context.asT2() == this)
-        _s->m_context = _c;
-}
-
-bool QQmlAbstractExpression::DeleteWatcher::wasDeleted() const
-{
-    return *_w == 0;
-}
-
-QT_END_NAMESPACE
-
-#endif // QQMLABSTRACTEXPRESSION_P_H
index 455c94f..2a53365 100644 (file)
@@ -71,7 +71,7 @@ QQmlBinding::QQmlBinding(const QString &str, QObject *obj, QQmlContext *ctxt)
 : QQmlJavaScriptExpression(&QQmlBinding_jsvtable), QQmlAbstractBinding(Binding)
 {
     setNotifyOnValueChanged(true);
-    QQmlAbstractExpression::setContext(QQmlContextData::get(ctxt));
+    QQmlJavaScriptExpression::setContext(QQmlContextData::get(ctxt));
     setScopeObject(obj);
 
     QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(context()->engine)->v4engine();
@@ -100,7 +100,7 @@ QQmlBinding::QQmlBinding(const QQmlScriptString &script, QObject *obj, QQmlConte
     }
 
     setNotifyOnValueChanged(true);
-    QQmlAbstractExpression::setContext(QQmlContextData::get(ctxt ? ctxt : scriptPrivate->context));
+    QQmlJavaScriptExpression::setContext(QQmlContextData::get(ctxt ? ctxt : scriptPrivate->context));
     setScopeObject(obj ? obj : scriptPrivate->scope);
 
     QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(context()->engine)->v4engine();
@@ -116,7 +116,7 @@ QQmlBinding::QQmlBinding(const QString &str, QObject *obj, QQmlContextData *ctxt
 : QQmlJavaScriptExpression(&QQmlBinding_jsvtable), QQmlAbstractBinding(Binding)
 {
     setNotifyOnValueChanged(true);
-    QQmlAbstractExpression::setContext(ctxt);
+    QQmlJavaScriptExpression::setContext(ctxt);
     setScopeObject(obj);
 
     QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(context()->engine)->v4engine();
@@ -130,7 +130,7 @@ QQmlBinding::QQmlBinding(const QString &str, QObject *obj,
 {
     Q_UNUSED(columnNumber);
     setNotifyOnValueChanged(true);
-    QQmlAbstractExpression::setContext(ctxt);
+    QQmlJavaScriptExpression::setContext(ctxt);
     setScopeObject(obj);
 
     QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(context()->engine)->v4engine();
@@ -141,7 +141,7 @@ QQmlBinding::QQmlBinding(const QV4::Value &functionPtr, QObject *obj, QQmlContex
 : QQmlJavaScriptExpression(&QQmlBinding_jsvtable), QQmlAbstractBinding(Binding)
 {
     setNotifyOnValueChanged(true);
-    QQmlAbstractExpression::setContext(ctxt);
+    QQmlJavaScriptExpression::setContext(ctxt);
     setScopeObject(obj);
 
     v4function.set(functionPtr.as<QV4::Object>()->engine(), functionPtr);
@@ -174,7 +174,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags)
         QQmlBindingProfiler prof(ep->profiler, f);
         setUpdatingFlag(true);
 
-        QQmlAbstractExpression::DeleteWatcher watcher(this);
+        QQmlJavaScriptExpression::DeleteWatcher watcher(this);
 
         if (m_core.propType == qMetaTypeId<QQmlBinding *>()) {
 
index 1e440b2..79c6157 100644 (file)
 
 #include <private/qpointervaluepair_p.h>
 #include <private/qqmlabstractbinding_p.h>
-#include <private/qqmlabstractexpression_p.h>
 #include <private/qqmljavascriptexpression_p.h>
 
 QT_BEGIN_NAMESPACE
 
 class QQmlContext;
 class Q_QML_PRIVATE_EXPORT QQmlBinding : public QQmlJavaScriptExpression,
-                                         public QQmlAbstractExpression,
                                          public QQmlAbstractBinding
 {
 public:
@@ -81,7 +79,7 @@ public:
 
     void setNotifyOnValueChanged(bool);
 
-    // Inherited from  QQmlAbstractExpression
+    // Inherited from  QQmlJavaScriptExpression
     virtual void refresh();
 
     // "Inherited" from  QQmlAbstractBinding
index 8d677ea..c65742d 100644 (file)
@@ -47,7 +47,6 @@
 
 #include <QtCore/qmetaobject.h>
 
-#include <private/qqmlabstractexpression_p.h>
 #include <private/qqmljavascriptexpression_p.h>
 #include <private/qqmlboundsignalexpressionpointer_p.h>
 #include <private/qqmlnotifier_p.h>
@@ -58,7 +57,7 @@
 
 QT_BEGIN_NAMESPACE
 
-class Q_QML_PRIVATE_EXPORT QQmlBoundSignalExpression : public QQmlAbstractExpression, public QQmlJavaScriptExpression, public QQmlRefCount
+class Q_QML_PRIVATE_EXPORT QQmlBoundSignalExpression : public QQmlJavaScriptExpression, public QQmlRefCount
 {
 public:
     QQmlBoundSignalExpression(QObject *target, int index,
index f08f650..f10d8ec 100644 (file)
@@ -585,9 +585,9 @@ void QQmlContextData::clearContext()
 {
     emitDestruction();
 
-    QQmlAbstractExpression *expression = expressions;
+    QQmlJavaScriptExpression *expression = expressions;
     while (expression) {
-        QQmlAbstractExpression *nextExpression = expression->m_nextExpression;
+        QQmlJavaScriptExpression *nextExpression = expression->m_nextExpression;
 
         expression->m_prevExpression = 0;
         expression->m_nextExpression = 0;
@@ -652,9 +652,9 @@ void QQmlContextData::setParent(QQmlContextData *p, bool parentTakesOwnership)
     }
 }
 
-void QQmlContextData::refreshExpressionsRecursive(QQmlAbstractExpression *expression)
+void QQmlContextData::refreshExpressionsRecursive(QQmlJavaScriptExpression *expression)
 {
-    QQmlAbstractExpression::DeleteWatcher w(expression);
+    QQmlJavaScriptExpression::DeleteWatcher w(expression);
 
     if (expression->m_nextExpression)
         refreshExpressionsRecursive(expression->m_nextExpression);
index f5fd7d0..95254d4 100644 (file)
@@ -69,7 +69,7 @@ class QQmlExpression;
 class QQmlEngine;
 class QQmlExpression;
 class QQmlExpressionPrivate;
-class QQmlAbstractExpression;
+class QQmlJavaScriptExpression;
 class QQmlContextData;
 
 class QQmlContextPrivate : public QObjectPrivate
@@ -171,7 +171,7 @@ public:
     QQmlContextData **prevChild;
 
     // Expressions that use this context
-    QQmlAbstractExpression *expressions;
+    QQmlJavaScriptExpression *expressions;
 
     // Doubly-linked list of objects that are owned by this context
     QQmlData *contextObjects;
@@ -212,7 +212,7 @@ public:
 
 private:
     void refreshExpressionsRecursive(bool isGlobal);
-    void refreshExpressionsRecursive(QQmlAbstractExpression *);
+    void refreshExpressionsRecursive(QQmlJavaScriptExpression *);
     ~QQmlContextData() {}
 };
 
index 35e0bc8..9617e43 100644 (file)
@@ -65,7 +65,7 @@ void QQmlExpressionPrivate::init(QQmlContextData *ctxt, const QString &expr, QOb
 {
     expression = expr;
 
-    QQmlAbstractExpression::setContext(ctxt);
+    QQmlJavaScriptExpression::setContext(ctxt);
     setScopeObject(me);
     expressionFunctionValid = false;
 }
@@ -76,7 +76,7 @@ void QQmlExpressionPrivate::init(QQmlContextData *ctxt, QV4::Function *runtimeFu
     QV4::ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(ctxt->engine);
     function.set(engine, QV4::QmlBindingWrapper::createQmlCallableForFunction(ctxt, me, runtimeFunction));
 
-    QQmlAbstractExpression::setContext(ctxt);
+    QQmlJavaScriptExpression::setContext(ctxt);
     setScopeObject(me);
 }
 
index d8da387..f1c02c5 100644 (file)
@@ -52,7 +52,6 @@
 #include <private/qflagpointer_p.h>
 #include <private/qdeletewatcher_p.h>
 #include <private/qpointervaluepair_p.h>
-#include <private/qqmlabstractexpression_p.h>
 #include <private/qqmljavascriptexpression_p.h>
 
 QT_BEGIN_NAMESPACE
@@ -60,8 +59,7 @@ QT_BEGIN_NAMESPACE
 class QQmlExpression;
 class QString;
 class QQmlExpressionPrivate : public QObjectPrivate,
-                              public QQmlJavaScriptExpression,
-                              public QQmlAbstractExpression
+                              public QQmlJavaScriptExpression
 {
     Q_DECLARE_PUBLIC(QQmlExpression)
 public:
index b353e77..41599a9 100644 (file)
@@ -84,12 +84,21 @@ void QQmlDelayedError::catchJavaScriptException(QV4::ExecutionEngine *engine)
 
 
 QQmlJavaScriptExpression::QQmlJavaScriptExpression(VTable *v)
-: m_vtable(v)
+    : m_vtable(v),
+      m_context(0),
+      m_prevExpression(0),
+      m_nextExpression(0)
 {
 }
 
 QQmlJavaScriptExpression::~QQmlJavaScriptExpression()
 {
+    if (m_prevExpression) {
+        *m_prevExpression = m_nextExpression;
+        if (m_nextExpression)
+            m_nextExpression->m_prevExpression = m_prevExpression;
+    }
+
     clearGuards();
     if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
         m_scopeObject.asT2()->_s = 0;
@@ -106,6 +115,31 @@ void QQmlJavaScriptExpression::resetNotifyOnValueChanged()
     clearGuards();
 }
 
+void QQmlJavaScriptExpression::setContext(QQmlContextData *context)
+{
+    if (m_prevExpression) {
+        *m_prevExpression = m_nextExpression;
+        if (m_nextExpression)
+            m_nextExpression->m_prevExpression = m_prevExpression;
+        m_prevExpression = 0;
+        m_nextExpression = 0;
+    }
+
+    m_context = context;
+
+    if (context) {
+        m_nextExpression = context->expressions;
+        if (m_nextExpression)
+            m_nextExpression->m_prevExpression = &m_nextExpression;
+        m_prevExpression = &context->expressions;
+        context->expressions = this;
+    }
+}
+
+void QQmlJavaScriptExpression::refresh()
+{
+}
+
 QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
                                    const QV4::Value &function, bool *isUndefined)
 {
index 989d5a0..c8f5452 100644 (file)
@@ -89,7 +89,7 @@ private:
     QQmlDelayedError **prevError;
 };
 
-class QQmlJavaScriptExpression
+class Q_QML_PRIVATE_EXPORT QQmlJavaScriptExpression
 {
 public:
     // Although this looks crazy, we implement our own "vtable" here, rather than relying on
@@ -103,6 +103,7 @@ public:
     };
 
     QQmlJavaScriptExpression(VTable *vtable);
+    virtual ~QQmlJavaScriptExpression();
 
     QV4::ReturnedValue evaluate(QQmlContextData *, const QV4::Value &function, bool *isUndefined);
     QV4::ReturnedValue evaluate(QQmlContextData *, const QV4::Value &function, QV4::CallData *callData, bool *isUndefined);
@@ -115,6 +116,13 @@ public:
     inline QObject *scopeObject() const;
     inline void setScopeObject(QObject *v);
 
+    bool isValid() const { return context() != 0; }
+
+    QQmlContextData *context() const { return m_context; }
+    void setContext(QQmlContextData *context);
+
+    virtual void refresh();
+
     class DeleteWatcher {
     public:
         inline DeleteWatcher(QQmlJavaScriptExpression *);
@@ -143,10 +151,9 @@ public:
                                         const QString &code,
                                         const QString &filename, quint16 line,
                                         QV4::PersistentValue *qmlscope = 0);
-protected:
-    ~QQmlJavaScriptExpression();
 
 private:
+    friend class QQmlContextData;
     typedef QQmlJavaScriptExpressionGuard Guard;
     friend void QQmlJavaScriptExpressionGuard_callback(QQmlNotifierEndpoint *, void **);
 
@@ -176,6 +183,11 @@ private:
     //    activeGuards:flag2  - useSharedContext
     QBiPointer<QObject, DeleteWatcher> m_scopeObject;
     QForwardFieldList<Guard, &Guard::next> activeGuards;
+
+    QQmlContextData *m_context;
+    QQmlJavaScriptExpression **m_prevExpression;
+    QQmlJavaScriptExpression  *m_nextExpression;
+
 };
 
 QQmlJavaScriptExpression::DeleteWatcher::DeleteWatcher(QQmlJavaScriptExpression *e)
index 98e310e..ece1689 100644 (file)
@@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE
 class QQmlContext;
 class QQmlEnginePrivate;
 class QQmlJavaScriptExpression;
+
 class Q_QML_PRIVATE_EXPORT QQmlPropertyPrivate : public QQmlRefCount
 {
 public:
index c4b2325..06fbe94 100644 (file)
@@ -161,7 +161,7 @@ void tst_qqmlproperty::qmlmetaproperty()
     QWeakPointer<QQmlAbstractBinding> binding(QQmlAbstractBinding::getPointer(new QQmlBinding(QLatin1String("null"), 0, engine.rootContext())));
     QVERIFY(binding != 0);
     QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(obj, QObjectPrivate::get(obj)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-    QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+    QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
     QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
     QCOMPARE(prop.name(), QString());
@@ -410,7 +410,7 @@ void tst_qqmlproperty::qmlmetaproperty_object()
         QWeakPointer<QQmlAbstractBinding> binding(QQmlAbstractBinding::getPointer(new QQmlBinding(QLatin1String("null"), 0, engine.rootContext())));
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -458,7 +458,7 @@ void tst_qqmlproperty::qmlmetaproperty_object()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -513,7 +513,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
         QWeakPointer<QQmlAbstractBinding> binding(QQmlAbstractBinding::getPointer(new QQmlBinding(QLatin1String("null"), 0, engine.rootContext())));
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -561,7 +561,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -611,7 +611,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -660,7 +660,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -714,7 +714,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
         QWeakPointer<QQmlAbstractBinding> binding(QQmlAbstractBinding::getPointer(new QQmlBinding(QLatin1String("null"), 0, engine.rootContext())));
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -762,7 +762,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -817,7 +817,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
         QWeakPointer<QQmlAbstractBinding> binding(QQmlAbstractBinding::getPointer(new QQmlBinding(QLatin1String("null"), 0, engine.rootContext())));
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -865,7 +865,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -915,7 +915,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;
@@ -964,7 +964,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
         static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
         QVERIFY(binding != 0);
         QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
-        QQmlAbstractExpression::DeleteWatcher sigExprWatcher(sigExpr);
+        QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
         QVERIFY(sigExpr != 0 && !sigExprWatcher.wasDeleted());
 
         QObject *obj = new QObject;