diff options
Diffstat (limited to 'src/scripttools/debugging/qscriptdebuggervalueproperty.cpp')
-rw-r--r-- | src/scripttools/debugging/qscriptdebuggervalueproperty.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp index d15f512..f7cc899 100644 --- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp +++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp @@ -41,6 +41,7 @@ #include "qscriptdebuggervalueproperty_p.h" #include "qscriptdebuggervalue_p.h" +#include "qscriptdebuggerobjectsnapshotdelta_p.h" #include <QtCore/qatomic.h> #include <QtCore/qdatastream.h> @@ -105,7 +106,7 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QString &name, Constructs a QScriptDebuggerValueProperty that is a copy of the \a other property. */ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebuggerValueProperty &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -116,10 +117,6 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebugger */ QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } /*! @@ -127,13 +124,7 @@ QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty() */ QScriptDebuggerValueProperty &QScriptDebuggerValueProperty::operator=(const QScriptDebuggerValueProperty &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } @@ -225,4 +216,20 @@ QDataStream &operator>>(QDataStream &in, QScriptDebuggerValueProperty &property) return in; } +QDataStream &operator<<(QDataStream &out, const QScriptDebuggerObjectSnapshotDelta &delta) +{ + out << delta.removedProperties; + out << delta.changedProperties; + out << delta.addedProperties; + return out; +} + +QDataStream &operator>>(QDataStream &in, QScriptDebuggerObjectSnapshotDelta &delta) +{ + in >> delta.removedProperties; + in >> delta.changedProperties; + in >> delta.addedProperties; + return in; +} + QT_END_NAMESPACE |