summaryrefslogtreecommitdiffstats
path: root/src/scripttools
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripttools')
-rw-r--r--src/scripttools/debugging/qscriptbreakpointdata.cpp5
-rw-r--r--src/scripttools/debugging/qscriptbreakpointdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend_p.h2
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommand.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommand_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsole_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp14
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerfrontend.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerfrontend_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggerjob.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerjob_p.h3
-rw-r--r--src/scripttools/debugging/qscriptdebuggerresponse.cpp5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerresponse_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalue.cpp16
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalue_p.h4
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty.cpp14
-rw-r--r--src/scripttools/debugging/qscriptdebuggervalueproperty_p.h3
-rw-r--r--src/scripttools/debugging/qscriptscriptdata.cpp20
-rw-r--r--src/scripttools/debugging/qscriptscriptdata_p.h4
-rw-r--r--src/scripttools/debugging/qscriptstdmessagehandler.cpp1
-rw-r--r--src/scripttools/debugging/qscriptstdmessagehandler_p.h4
-rw-r--r--src/scripttools/debugging/qscriptvalueproperty.cpp14
-rw-r--r--src/scripttools/debugging/qscriptvalueproperty_p.h3
-rw-r--r--src/scripttools/scripttools.pro2
35 files changed, 58 insertions, 110 deletions
diff --git a/src/scripttools/debugging/qscriptbreakpointdata.cpp b/src/scripttools/debugging/qscriptbreakpointdata.cpp
index 46aa58affa..94a6a806b6 100644
--- a/src/scripttools/debugging/qscriptbreakpointdata.cpp
+++ b/src/scripttools/debugging/qscriptbreakpointdata.cpp
@@ -136,7 +136,6 @@ QScriptBreakpointData::QScriptBreakpointData(const QScriptBreakpointData &other)
*/
QScriptBreakpointData::~QScriptBreakpointData()
{
- delete d_ptr;
}
/*!
@@ -355,7 +354,7 @@ bool QScriptBreakpointData::operator!=(const QScriptBreakpointData &other) const
*/
QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data)
{
- const QScriptBreakpointDataPrivate *d = data.d_ptr;
+ const QScriptBreakpointDataPrivate *d = data.d_ptr.data();
out << d->scriptId;
out << d->fileName;
out << d->lineNumber;
@@ -377,7 +376,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data)
*/
QDataStream &operator>>(QDataStream &in, QScriptBreakpointData &data)
{
- QScriptBreakpointDataPrivate *d = data.d_ptr;
+ QScriptBreakpointDataPrivate *d = data.d_ptr.data();
in >> d->scriptId;
in >> d->fileName;
in >> d->lineNumber;
diff --git a/src/scripttools/debugging/qscriptbreakpointdata_p.h b/src/scripttools/debugging/qscriptbreakpointdata_p.h
index 146789a53b..e9d6386fda 100644
--- a/src/scripttools/debugging/qscriptbreakpointdata_p.h
+++ b/src/scripttools/debugging/qscriptbreakpointdata_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
@@ -114,7 +114,7 @@ public:
bool operator!=(const QScriptBreakpointData &other) const;
private:
- QScriptBreakpointDataPrivate *d_ptr;
+ QScopedPointer<QScriptBreakpointDataPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptBreakpointData)
};
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
index 3a5b400195..d6f63eefc9 100644
--- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
@@ -385,7 +385,6 @@ QScriptDebuggerBackend::QScriptDebuggerBackend()
QScriptDebuggerBackend::~QScriptDebuggerBackend()
{
detach();
- delete d_ptr;
}
/*!
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend_p.h b/src/scripttools/debugging/qscriptdebuggerbackend_p.h
index 5f18e7069d..120d96ba8c 100644
--- a/src/scripttools/debugging/qscriptdebuggerbackend_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerbackend_p.h
@@ -144,7 +144,7 @@ protected:
protected:
QScriptDebuggerBackend(QScriptDebuggerBackendPrivate &dd);
- QScriptDebuggerBackendPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerBackendPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerBackend)
diff --git a/src/scripttools/debugging/qscriptdebuggercommand.cpp b/src/scripttools/debugging/qscriptdebuggercommand.cpp
index 1691fbab81..638d58ade9 100644
--- a/src/scripttools/debugging/qscriptdebuggercommand.cpp
+++ b/src/scripttools/debugging/qscriptdebuggercommand.cpp
@@ -119,7 +119,6 @@ QScriptDebuggerCommand::QScriptDebuggerCommand(const QScriptDebuggerCommand &oth
*/
QScriptDebuggerCommand::~QScriptDebuggerCommand()
{
- delete d_ptr;
}
/*!
@@ -666,7 +665,7 @@ QScriptDebuggerCommand QScriptDebuggerCommand::clearExceptionsCommand()
*/
QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command)
{
- const QScriptDebuggerCommandPrivate *d = command.d_ptr;
+ const QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
out << (quint32)d->type;
out << (qint32)d->attributes.size();
QHash<QScriptDebuggerCommand::Attribute, QVariant>::const_iterator it;
@@ -686,7 +685,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command)
*/
QDataStream &operator>>(QDataStream &in, QScriptDebuggerCommand &command)
{
- QScriptDebuggerCommandPrivate *d = command.d_ptr;
+ QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
quint32 type;
in >> type;
diff --git a/src/scripttools/debugging/qscriptdebuggercommand_p.h b/src/scripttools/debugging/qscriptdebuggercommand_p.h
index 4d4ef22041..b252853441 100644
--- a/src/scripttools/debugging/qscriptdebuggercommand_p.h
+++ b/src/scripttools/debugging/qscriptdebuggercommand_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
@@ -255,7 +255,7 @@ public:
static QScriptDebuggerCommand clearExceptionsCommand();
private:
- QScriptDebuggerCommandPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerCommandPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerCommand)
};
diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
index d8b2e871a0..7dcb0ee729 100644
--- a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
+++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp
@@ -98,7 +98,6 @@ QScriptDebuggerCommandExecutor::QScriptDebuggerCommandExecutor()
QScriptDebuggerCommandExecutor::~QScriptDebuggerCommandExecutor()
{
- delete d_ptr;
}
static bool isPrefixOf(const QString &prefix, const QString &what)
diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h b/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h
index e91dfe7303..8e6813e1e4 100644
--- a/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h
+++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
@@ -74,7 +75,7 @@ public:
protected:
QScriptDebuggerCommandExecutor(QScriptDebuggerCommandExecutorPrivate &dd);
- QScriptDebuggerCommandExecutorPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerCommandExecutorPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerCommandExecutor)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsole.cpp b/src/scripttools/debugging/qscriptdebuggerconsole.cpp
index 856f8b3fe1..06646f1fc0 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsole.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsole.cpp
@@ -199,7 +199,6 @@ QScriptDebuggerConsole::QScriptDebuggerConsole()
QScriptDebuggerConsole::~QScriptDebuggerConsole()
{
- delete d_ptr;
}
void QScriptDebuggerConsole::loadScriptedCommands(const QString &scriptsPath,
diff --git a/src/scripttools/debugging/qscriptdebuggerconsole_p.h b/src/scripttools/debugging/qscriptdebuggerconsole_p.h
index 2f76db6c0d..b209a651de 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsole_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsole_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
#include "qscriptdebuggerconsolehistorianinterface_p.h"
@@ -109,7 +110,7 @@ public:
void bumpSessionId();
private:
- QScriptDebuggerConsolePrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerConsolePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerConsole)
Q_DISABLE_COPY(QScriptDebuggerConsole)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp
index e2d7819636..c3d148623b 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp
@@ -72,7 +72,6 @@ QScriptDebuggerConsoleCommand::QScriptDebuggerConsoleCommand()
QScriptDebuggerConsoleCommand::~QScriptDebuggerConsoleCommand()
{
- delete d_ptr;
}
QScriptDebuggerConsoleCommand::QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h
index c3fe94a2d6..6811799880 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
@@ -91,7 +91,7 @@ public:
protected:
QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd);
- QScriptDebuggerConsoleCommandPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerConsoleCommandPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommand)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp
index 9942a87465..804e2758d7 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp
@@ -90,7 +90,7 @@ QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
const QScriptDebuggerConsoleCommandGroupData &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -98,22 +98,12 @@ QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData(
QScriptDebuggerConsoleCommandGroupData::~QScriptDebuggerConsoleCommandGroupData()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
QScriptDebuggerConsoleCommandGroupData &QScriptDebuggerConsoleCommandGroupData::operator=(
const QScriptDebuggerConsoleCommandGroupData &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;
}
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h
index e7727f8f7c..81e25e406b 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
@@ -82,7 +82,7 @@ public:
const QScriptDebuggerConsoleCommandGroupData &other);
private:
- QScriptDebuggerConsoleCommandGroupDataPrivate *d_ptr;
+ QScopedSharedPointer<QScriptDebuggerConsoleCommandGroupDataPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandGroupData)
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
index ca4fcc2d90..6ed7e0ec21 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp
@@ -105,7 +105,6 @@ QScriptDebuggerConsoleCommandManager::QScriptDebuggerConsoleCommandManager()
QScriptDebuggerConsoleCommandManager::~QScriptDebuggerConsoleCommandManager()
{
- delete d_ptr;
}
/*!
diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h
index 2bc47d8475..ff68bedde6 100644
--- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
#include <QtCore/qlist.h>
@@ -86,7 +86,7 @@ public:
QStringList completions(const QString &prefix) const;
private:
- QScriptDebuggerConsoleCommandManagerPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerConsoleCommandManagerPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandManager)
};
diff --git a/src/scripttools/debugging/qscriptdebuggerevent.cpp b/src/scripttools/debugging/qscriptdebuggerevent.cpp
index ce08c9d19d..5fab17eb14 100644
--- a/src/scripttools/debugging/qscriptdebuggerevent.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerevent.cpp
@@ -97,7 +97,6 @@ QScriptDebuggerEvent::QScriptDebuggerEvent(const QScriptDebuggerEvent &other)
QScriptDebuggerEvent::~QScriptDebuggerEvent()
{
- delete d_ptr;
}
QScriptDebuggerEvent &QScriptDebuggerEvent::operator=(const QScriptDebuggerEvent &other)
@@ -276,7 +275,7 @@ bool QScriptDebuggerEvent::operator!=(const QScriptDebuggerEvent &other) const
*/
QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event)
{
- const QScriptDebuggerEventPrivate *d = event.d_ptr;
+ const QScriptDebuggerEventPrivate *d = event.d_ptr.data();
out << (quint32)d->type;
out << (qint32)d->attributes.size();
QHash<QScriptDebuggerEvent::Attribute, QVariant>::const_iterator it;
@@ -296,7 +295,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event)
*/
QDataStream &operator>>(QDataStream &in, QScriptDebuggerEvent &event)
{
- QScriptDebuggerEventPrivate *d = event.d_ptr;
+ QScriptDebuggerEventPrivate *d = event.d_ptr.data();
quint32 type;
in >> type;
diff --git a/src/scripttools/debugging/qscriptdebuggerevent_p.h b/src/scripttools/debugging/qscriptdebuggerevent_p.h
index f85457415c..72e86cb2f2 100644
--- a/src/scripttools/debugging/qscriptdebuggerevent_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerevent_p.h
@@ -57,6 +57,7 @@
#include <QtCore/qcoreevent.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
@@ -137,7 +138,7 @@ public:
bool operator!=(const QScriptDebuggerEvent &other) const;
private:
- QScriptDebuggerEventPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerEventPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerEvent)
};
diff --git a/src/scripttools/debugging/qscriptdebuggerfrontend.cpp b/src/scripttools/debugging/qscriptdebuggerfrontend.cpp
index e58bfecbbd..24c1cfffde 100644
--- a/src/scripttools/debugging/qscriptdebuggerfrontend.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerfrontend.cpp
@@ -143,7 +143,6 @@ QScriptDebuggerFrontend::QScriptDebuggerFrontend()
QScriptDebuggerFrontend::~QScriptDebuggerFrontend()
{
- delete d_ptr;
}
QScriptDebuggerFrontend::QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd)
diff --git a/src/scripttools/debugging/qscriptdebuggerfrontend_p.h b/src/scripttools/debugging/qscriptdebuggerfrontend_p.h
index faad0fdfb3..2b6a319429 100644
--- a/src/scripttools/debugging/qscriptdebuggerfrontend_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerfrontend_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qstring.h>
#include "qscriptdebuggercommandschedulerinterface_p.h"
@@ -90,7 +90,7 @@ protected:
protected:
QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd);
- QScriptDebuggerFrontendPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerFrontendPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerFrontend)
diff --git a/src/scripttools/debugging/qscriptdebuggerjob.cpp b/src/scripttools/debugging/qscriptdebuggerjob.cpp
index 0ed1137803..8b25f5c258 100644
--- a/src/scripttools/debugging/qscriptdebuggerjob.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerjob.cpp
@@ -85,7 +85,6 @@ QScriptDebuggerJob::QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd)
QScriptDebuggerJob::~QScriptDebuggerJob()
{
- delete d_ptr;
}
void QScriptDebuggerJob::finish()
diff --git a/src/scripttools/debugging/qscriptdebuggerjob_p.h b/src/scripttools/debugging/qscriptdebuggerjob_p.h
index 90f82a822d..4fa0f91baf 100644
--- a/src/scripttools/debugging/qscriptdebuggerjob_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerjob_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
@@ -76,7 +77,7 @@ public:
protected:
QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd);
- QScriptDebuggerJobPrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerJobPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptDebuggerJob)
diff --git a/src/scripttools/debugging/qscriptdebuggerresponse.cpp b/src/scripttools/debugging/qscriptdebuggerresponse.cpp
index 0ad9e75ab1..2fd6f37c7b 100644
--- a/src/scripttools/debugging/qscriptdebuggerresponse.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerresponse.cpp
@@ -101,7 +101,6 @@ QScriptDebuggerResponse::QScriptDebuggerResponse(const QScriptDebuggerResponse &
QScriptDebuggerResponse::~QScriptDebuggerResponse()
{
- delete d_ptr;
}
QScriptDebuggerResponse &QScriptDebuggerResponse::operator=(const QScriptDebuggerResponse &other)
@@ -320,7 +319,7 @@ bool QScriptDebuggerResponse::operator!=(const QScriptDebuggerResponse &other) c
*/
QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &response)
{
- const QScriptDebuggerResponsePrivate *d = response.d_ptr;
+ const QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
out << (quint32)d->error;
out << d->result;
out << d->async;
@@ -336,7 +335,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &respons
*/
QDataStream &operator>>(QDataStream &in, QScriptDebuggerResponse &response)
{
- QScriptDebuggerResponsePrivate *d = response.d_ptr;
+ QScriptDebuggerResponsePrivate *d = response.d_ptr.data();
quint32 error;
in >> error;
diff --git a/src/scripttools/debugging/qscriptdebuggerresponse_p.h b/src/scripttools/debugging/qscriptdebuggerresponse_p.h
index a63b0d5cae..723dd8ef4f 100644
--- a/src/scripttools/debugging/qscriptdebuggerresponse_p.h
+++ b/src/scripttools/debugging/qscriptdebuggerresponse_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qmap.h>
#include <QtCore/qvariant.h>
@@ -127,7 +127,7 @@ public:
bool operator!=(const QScriptDebuggerResponse &other) const;
private:
- QScriptDebuggerResponsePrivate *d_ptr;
+ QScopedPointer<QScriptDebuggerResponsePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerResponse)
};
diff --git a/src/scripttools/debugging/qscriptdebuggervalue.cpp b/src/scripttools/debugging/qscriptdebuggervalue.cpp
index cf518dcb91..12f837a73e 100644
--- a/src/scripttools/debugging/qscriptdebuggervalue.cpp
+++ b/src/scripttools/debugging/qscriptdebuggervalue.cpp
@@ -94,7 +94,7 @@ QScriptDebuggerValue::QScriptDebuggerValue(const QScriptValue &value)
: d_ptr(0)
{
if (value.isValid()) {
- d_ptr = new QScriptDebuggerValuePrivate;
+ d_ptr.reset(new QScriptDebuggerValuePrivate);
if (value.isUndefined())
d_ptr->type = UndefinedValue;
else if (value.isNull())
@@ -157,7 +157,7 @@ QScriptDebuggerValue::QScriptDebuggerValue(ValueType type)
}
QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -165,21 +165,11 @@ QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other)
QScriptDebuggerValue::~QScriptDebuggerValue()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
QScriptDebuggerValue &QScriptDebuggerValue::operator=(const QScriptDebuggerValue &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;
}
diff --git a/src/scripttools/debugging/qscriptdebuggervalue_p.h b/src/scripttools/debugging/qscriptdebuggervalue_p.h
index d0ac720e58..a08b923c99 100644
--- a/src/scripttools/debugging/qscriptdebuggervalue_p.h
+++ b/src/scripttools/debugging/qscriptdebuggervalue_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
@@ -103,7 +103,7 @@ public:
bool operator!=(const QScriptDebuggerValue &other) const;
private:
- QScriptDebuggerValuePrivate *d_ptr;
+ QScopedSharedPointer<QScriptDebuggerValuePrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerValue)
};
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
index aaf637f46e..7f4708be2d 100644
--- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
+++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp
@@ -106,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();
@@ -117,10 +117,6 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebugger
*/
QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -128,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;
}
diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h b/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h
index 36d5c55d5c..43a5be6cf4 100644
--- a/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h
+++ b/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h
@@ -55,6 +55,7 @@
#include <QtCore/qobjectdefs.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
@@ -85,7 +86,7 @@ public:
bool isValid() const;
private:
- QScriptDebuggerValuePropertyPrivate *d_ptr;
+ QScopedSharedPointer<QScriptDebuggerValuePropertyPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptDebuggerValueProperty)
};
diff --git a/src/scripttools/debugging/qscriptscriptdata.cpp b/src/scripttools/debugging/qscriptscriptdata.cpp
index 5194a8b885..d9d93a914b 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;
diff --git a/src/scripttools/debugging/qscriptscriptdata_p.h b/src/scripttools/debugging/qscriptscriptdata_p.h
index 40394f42a8..bc6aa9f81e 100644
--- a/src/scripttools/debugging/qscriptscriptdata_p.h
+++ b/src/scripttools/debugging/qscriptscriptdata_p.h
@@ -54,7 +54,7 @@
//
#include <QtCore/qobjectdefs.h>
-
+#include <QtCore/qscopedpointer.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qmap.h>
@@ -91,7 +91,7 @@ public:
bool operator!=(const QScriptScriptData &other) const;
private:
- QScriptScriptDataPrivate *d_ptr;
+ QScopedSharedPointer<QScriptScriptDataPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptScriptData)
};
diff --git a/src/scripttools/debugging/qscriptstdmessagehandler.cpp b/src/scripttools/debugging/qscriptstdmessagehandler.cpp
index 5fb2db906b..d2aa1cf435 100644
--- a/src/scripttools/debugging/qscriptstdmessagehandler.cpp
+++ b/src/scripttools/debugging/qscriptstdmessagehandler.cpp
@@ -66,7 +66,6 @@ QScriptStdMessageHandler::QScriptStdMessageHandler()
QScriptStdMessageHandler::~QScriptStdMessageHandler()
{
- delete d_ptr;
}
void QScriptStdMessageHandler::message(QtMsgType type, const QString &text,
diff --git a/src/scripttools/debugging/qscriptstdmessagehandler_p.h b/src/scripttools/debugging/qscriptstdmessagehandler_p.h
index 899f61dd5d..d7e36deade 100644
--- a/src/scripttools/debugging/qscriptstdmessagehandler_p.h
+++ b/src/scripttools/debugging/qscriptstdmessagehandler_p.h
@@ -53,6 +53,8 @@
// We mean it.
//
+#include <QtCore/qscopedpointer.h>
+
#include "qscriptmessagehandlerinterface_p.h"
QT_BEGIN_NAMESPACE
@@ -71,7 +73,7 @@ public:
const QVariant &data = QVariant());
private:
- QScriptStdMessageHandlerPrivate *d_ptr;
+ QScopedPointer<QScriptStdMessageHandlerPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QScriptStdMessageHandler)
diff --git a/src/scripttools/debugging/qscriptvalueproperty.cpp b/src/scripttools/debugging/qscriptvalueproperty.cpp
index 5f7e5632da..eeab20efad 100644
--- a/src/scripttools/debugging/qscriptvalueproperty.cpp
+++ b/src/scripttools/debugging/qscriptvalueproperty.cpp
@@ -95,7 +95,7 @@ QScriptValueProperty::QScriptValueProperty(const QString &name,
Constructs a QScriptValueProperty that is a copy of the \a other property.
*/
QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other)
- : d_ptr(other.d_ptr)
+ : d_ptr(other.d_ptr.data())
{
if (d_ptr)
d_ptr->ref.ref();
@@ -106,10 +106,6 @@ QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other)
*/
QScriptValueProperty::~QScriptValueProperty()
{
- if (d_ptr && !d_ptr->ref.deref()) {
- delete d_ptr;
- d_ptr = 0;
- }
}
/*!
@@ -117,13 +113,7 @@ QScriptValueProperty::~QScriptValueProperty()
*/
QScriptValueProperty &QScriptValueProperty::operator=(const QScriptValueProperty &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;
}
diff --git a/src/scripttools/debugging/qscriptvalueproperty_p.h b/src/scripttools/debugging/qscriptvalueproperty_p.h
index c11c2d3d76..e487ba5a83 100644
--- a/src/scripttools/debugging/qscriptvalueproperty_p.h
+++ b/src/scripttools/debugging/qscriptvalueproperty_p.h
@@ -55,6 +55,7 @@
#include <QtCore/qobjectdefs.h>
#include <QtCore/qlist.h>
+#include <QtCore/qscopedpointer.h>
#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
@@ -81,7 +82,7 @@ public:
bool isValid() const;
private:
- QScriptValuePropertyPrivate *d_ptr;
+ QScopedSharedPointer<QScriptValuePropertyPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptValueProperty)
};
diff --git a/src/scripttools/scripttools.pro b/src/scripttools/scripttools.pro
index faf0936ace..5878db2a0f 100644
--- a/src/scripttools/scripttools.pro
+++ b/src/scripttools/scripttools.pro
@@ -10,3 +10,5 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtScript
include(../qbase.pri)
include(debugging/debugging.pri)
+
+symbian:TARGET.UID3=0x2001E625