diff options
author | axis <qt-info@nokia.com> | 2009-08-21 14:29:28 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-08-21 14:29:28 (GMT) |
commit | e190e700d707c3000f813c106c27d8f5aeda44d0 (patch) | |
tree | 63fa8d66040ca5680b0a1b3d108a17ec2139f1e9 /src/scripttools/debugging/qscriptscriptdata.cpp | |
parent | 71a8a5c97315c114d55190594a7175552bfd41a6 (diff) | |
parent | ae42be87658ad97fad48706141779ec42c02212e (diff) | |
download | Qt-e190e700d707c3000f813c106c27d8f5aeda44d0.zip Qt-e190e700d707c3000f813c106c27d8f5aeda44d0.tar.gz Qt-e190e700d707c3000f813c106c27d8f5aeda44d0.tar.bz2 |
Merge branch 'master' of git@scm:qt/qt-s60-public
This brings support for the S60 platform into Qt.
Diffstat (limited to 'src/scripttools/debugging/qscriptscriptdata.cpp')
-rw-r--r-- | src/scripttools/debugging/qscriptscriptdata.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/scripttools/debugging/qscriptscriptdata.cpp b/src/scripttools/debugging/qscriptscriptdata.cpp index 5194a8b..d9d93a9 100644 --- a/src/scripttools/debugging/qscriptscriptdata.cpp +++ b/src/scripttools/debugging/qscriptscriptdata.cpp @@ -98,7 +98,7 @@ QScriptScriptData::QScriptScriptData(const QString &contents, const QString &fil } QScriptScriptData::QScriptScriptData(const QScriptScriptData &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -106,21 +106,11 @@ QScriptScriptData::QScriptScriptData(const QScriptScriptData &other) QScriptScriptData::~QScriptScriptData() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } QScriptScriptData &QScriptScriptData::operator=(const QScriptScriptData &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; } @@ -191,7 +181,7 @@ bool QScriptScriptData::operator!=(const QScriptScriptData &other) const QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data) { - const QScriptScriptDataPrivate *d = data.d_ptr; + const QScriptScriptDataPrivate *d = data.d_ptr.data(); if (d) { out << d->contents; out << d->fileName; @@ -207,10 +197,10 @@ QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data) QDataStream &operator>>(QDataStream &in, QScriptScriptData &data) { if (!data.d_ptr) { - data.d_ptr = new QScriptScriptDataPrivate(); + data.d_ptr.reset(new QScriptScriptDataPrivate()); data.d_ptr->ref.ref(); } - QScriptScriptDataPrivate *d = data.d_ptr; + QScriptScriptDataPrivate *d = data.d_ptr.data(); in >> d->contents; in >> d->fileName; qint32 ln; |