diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-07-08 15:01:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-11 13:28:17 +0200 |
commit | 9a85b921ac457c68cee0c89b8ad11433b1e92d07 (patch) | |
tree | 2d324a602a8b6658bbed405b6fe6ef374e5ed93e /src/scripttools/debugging | |
parent | b384be8ae195dd52f4f7ca18b0790e8b2793c314 (diff) | |
download | qtscript-9a85b921ac457c68cee0c89b8ad11433b1e92d07.tar.gz |
Replace all QAtomicInt ref variables by QSharedData inheritance.
There is no need to do reference counting by hand. QSharedData class
provide good encapsulation of reference counter.
Change-Id: I2611a51c2fa6673ccca69fe8ff83741ffac06ee9
Reviewed-on: http://codereview.qt.nokia.com/1378
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/scripttools/debugging')
5 files changed, 10 insertions, 17 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp index 7822e12..4d9c041 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp @@ -42,6 +42,7 @@ #include "qscriptdebuggerconsolecommandgroupdata_p.h" #include <QtCore/qstring.h> +#include <QtCore/qshareddata.h> QT_BEGIN_NAMESPACE @@ -53,7 +54,7 @@ QT_BEGIN_NAMESPACE \brief The QScriptDebuggerConsoleCommandGroupData class holds data associated with a console command group. */ -class QScriptDebuggerConsoleCommandGroupDataPrivate +class QScriptDebuggerConsoleCommandGroupDataPrivate : public QSharedData { public: QScriptDebuggerConsoleCommandGroupDataPrivate(); @@ -61,8 +62,6 @@ public: QString shortDescription; QString longDescription; - - QAtomicInt ref; }; QScriptDebuggerConsoleCommandGroupDataPrivate::QScriptDebuggerConsoleCommandGroupDataPrivate() diff --git a/src/scripttools/debugging/qscriptdebuggervalue.cpp b/src/scripttools/debugging/qscriptdebuggervalue.cpp index 5ece13d..a19a190 100644 --- a/src/scripttools/debugging/qscriptdebuggervalue.cpp +++ b/src/scripttools/debugging/qscriptdebuggervalue.cpp @@ -45,6 +45,7 @@ #include <QtScript/qscriptengine.h> #include <QtCore/qdatastream.h> #include <QtCore/qdebug.h> +#include <QtCore/qshareddata.h> QT_BEGIN_NAMESPACE @@ -56,7 +57,7 @@ QT_BEGIN_NAMESPACE \brief The QScriptDebuggerValue class represents a script value. */ -class QScriptDebuggerValuePrivate +class QScriptDebuggerValuePrivate : public QSharedData { public: QScriptDebuggerValuePrivate(); @@ -69,8 +70,6 @@ public: double numberValue; qint64 objectId; }; - - QAtomicInt ref; }; QScriptDebuggerValuePrivate::QScriptDebuggerValuePrivate() diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp index 02cc43d..d06f34f 100644 --- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp +++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp @@ -43,7 +43,7 @@ #include "qscriptdebuggervalue_p.h" #include "qscriptdebuggerobjectsnapshotdelta_p.h" -#include <QtCore/qatomic.h> +#include <QtCore/qshareddata.h> #include <QtCore/qdatastream.h> #include <QtCore/qstring.h> @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE \class QScriptDebuggerValueProperty */ -class QScriptDebuggerValuePropertyPrivate +class QScriptDebuggerValuePropertyPrivate : public QSharedData { public: QScriptDebuggerValuePropertyPrivate(); @@ -64,8 +64,6 @@ public: QScriptDebuggerValue value; QString valueAsString; QScriptValue::PropertyFlags flags; - - QAtomicInt ref; }; QScriptDebuggerValuePropertyPrivate::QScriptDebuggerValuePropertyPrivate() diff --git a/src/scripttools/debugging/qscriptscriptdata.cpp b/src/scripttools/debugging/qscriptscriptdata.cpp index 7723d6c..074c1e5 100644 --- a/src/scripttools/debugging/qscriptscriptdata.cpp +++ b/src/scripttools/debugging/qscriptscriptdata.cpp @@ -44,6 +44,7 @@ #include <QtCore/qdatastream.h> #include <QtCore/qstring.h> #include <QtCore/qstringlist.h> +#include <QtCore/qshareddata.h> QT_BEGIN_NAMESPACE @@ -55,7 +56,7 @@ QT_BEGIN_NAMESPACE \brief The QScriptScriptData class holds data associated with a script. */ -class QScriptScriptDataPrivate +class QScriptScriptDataPrivate : public QSharedData { public: QScriptScriptDataPrivate(); @@ -65,8 +66,6 @@ public: QString fileName; int baseLineNumber; QDateTime timeStamp; - - QAtomicInt ref; }; QScriptScriptDataPrivate::QScriptScriptDataPrivate() diff --git a/src/scripttools/debugging/qscriptvalueproperty.cpp b/src/scripttools/debugging/qscriptvalueproperty.cpp index 90c4dfc..4e16f9c 100644 --- a/src/scripttools/debugging/qscriptvalueproperty.cpp +++ b/src/scripttools/debugging/qscriptvalueproperty.cpp @@ -41,12 +41,12 @@ #include "qscriptvalueproperty_p.h" -#include <QtCore/qatomic.h> +#include <QtCore/qshareddata.h> #include <QtCore/qstring.h> QT_BEGIN_NAMESPACE -class QScriptValuePropertyPrivate +class QScriptValuePropertyPrivate : public QSharedData { public: QScriptValuePropertyPrivate(); @@ -55,8 +55,6 @@ public: QString name; QScriptValue value; QScriptValue::PropertyFlags flags; - - QAtomicInt ref; }; QScriptValuePropertyPrivate::QScriptValuePropertyPrivate() |