diff options
Diffstat (limited to 'src/scripttools/debugging/qscriptdebuggervalueproperty.cpp')
-rw-r--r-- | src/scripttools/debugging/qscriptdebuggervalueproperty.cpp | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp index 093bfd9..f7cc899 100644 --- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp +++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtSCriptTools module of the Qt Toolkit. @@ -21,9 +20,10 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -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 |