summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-08-20 15:05:26 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-08-20 15:12:26 (GMT)
commit364089980339d5943a0a49558b035d0bd0b39f96 (patch)
treeb61213e541da84f9c62fd5952affdcaa3c437c10 /src/script
parentcba8480bb6b2552b20e3d923ea9425291e38c156 (diff)
downloadQt-364089980339d5943a0a49558b035d0bd0b39f96.zip
Qt-364089980339d5943a0a49558b035d0bd0b39f96.tar.gz
Qt-364089980339d5943a0a49558b035d0bd0b39f96.tar.bz2
Use QExplicitlySharedDataPointer
... instead of QScopedSharedPointer
Diffstat (limited to 'src/script')
-rw-r--r--src/script/qscriptcontextinfo.cpp12
-rw-r--r--src/script/qscriptcontextinfo.h4
-rw-r--r--src/script/qscriptengine.cpp8
-rw-r--r--src/script/qscriptengine.h4
4 files changed, 10 insertions, 18 deletions
diff --git a/src/script/qscriptcontextinfo.cpp b/src/script/qscriptcontextinfo.cpp
index 6467360..e145394 100644
--- a/src/script/qscriptcontextinfo.cpp
+++ b/src/script/qscriptcontextinfo.cpp
@@ -207,9 +207,8 @@ QScriptContextInfo::QScriptContextInfo(const QScriptContext *context)
: d_ptr(0)
{
if (context) {
- d_ptr.data_ptr() = new QScriptContextInfoPrivate(context);
+ d_ptr = new QScriptContextInfoPrivate(context);
d_ptr->q_ptr = this;
- d_ptr->ref.ref();
}
}
@@ -217,10 +216,8 @@ QScriptContextInfo::QScriptContextInfo(const QScriptContext *context)
Constructs a new QScriptContextInfo from the \a other info.
*/
QScriptContextInfo::QScriptContextInfo(const QScriptContextInfo &other)
- : d_ptr(other.d_ptr.data())
+ : d_ptr(other.d_ptr)
{
- if (d_ptr)
- d_ptr->ref.ref();
}
/*!
@@ -246,7 +243,7 @@ QScriptContextInfo::~QScriptContextInfo()
*/
QScriptContextInfo &QScriptContextInfo::operator=(const QScriptContextInfo &other)
{
- d_ptr.assign(other.d_ptr.data());
+ d_ptr = other.d_ptr;
return *this;
}
@@ -497,8 +494,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptContextInfo &info)
Q_SCRIPT_EXPORT QDataStream &operator>>(QDataStream &in, QScriptContextInfo &info)
{
if (!info.d_ptr) {
- info.d_ptr.data_ptr() = new QScriptContextInfoPrivate();
- info.d_ptr->ref.ref();
+ info.d_ptr = new QScriptContextInfoPrivate();
}
in >> info.d_ptr->scriptId;
diff --git a/src/script/qscriptcontextinfo.h b/src/script/qscriptcontextinfo.h
index 433a308..9cc64ff 100644
--- a/src/script/qscriptcontextinfo.h
+++ b/src/script/qscriptcontextinfo.h
@@ -48,7 +48,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qstringlist.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
QT_BEGIN_HEADER
@@ -105,7 +105,7 @@ public:
bool operator!=(const QScriptContextInfo &other) const;
private:
- QScopedSharedPointer<QScriptContextInfoPrivate> d_ptr;
+ QExplicitlySharedDataPointer<QScriptContextInfoPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptContextInfo)
};
diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp
index 07fed70..c8e19dd 100644
--- a/src/script/qscriptengine.cpp
+++ b/src/script/qscriptengine.cpp
@@ -1774,10 +1774,8 @@ QScriptValue QScriptEngine::objectById(qint64 id) const
Constructs a new QScriptSyntaxCheckResult from the \a other result.
*/
QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(const QScriptSyntaxCheckResult &other)
- : d_ptr(other.d_ptr.data())
+ : d_ptr(other.d_ptr)
{
- if (d_ptr)
- d_ptr->ref.ref();
}
/*!
@@ -1786,8 +1784,6 @@ QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(const QScriptSyntaxCheckResul
QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(QScriptSyntaxCheckResultPrivate *d)
: d_ptr(d)
{
- if (d_ptr)
- d_ptr->ref.ref();
}
/*!
@@ -1856,7 +1852,7 @@ QString QScriptSyntaxCheckResult::errorMessage() const
*/
QScriptSyntaxCheckResult &QScriptSyntaxCheckResult::operator=(const QScriptSyntaxCheckResult &other)
{
- d_ptr.assign(other.d_ptr.data());
+ d_ptr = other.d_ptr;
return *this;
}
diff --git a/src/script/qscriptengine.h b/src/script/qscriptengine.h
index 3cdedd9..62d67ff 100644
--- a/src/script/qscriptengine.h
+++ b/src/script/qscriptengine.h
@@ -47,7 +47,7 @@
#ifndef QT_NO_SCRIPT
#include <QtCore/qvariant.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qsharedpointer.h>
#ifndef QT_NO_QOBJECT
#include <QtCore/qobject.h>
@@ -115,7 +115,7 @@ public:
private:
QScriptSyntaxCheckResult();
QScriptSyntaxCheckResult(QScriptSyntaxCheckResultPrivate *d);
- QScopedSharedPointer<QScriptSyntaxCheckResultPrivate> d_ptr;
+ QExplicitlySharedDataPointer<QScriptSyntaxCheckResultPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptSyntaxCheckResult)
friend class QScriptEnginePrivate;