summaryrefslogtreecommitdiffstats
path: root/src/scripttools/debugging
diff options
context:
space:
mode:
authorKeith Isdale <keith.isdale@nokia.com>2009-07-01 02:35:46 (GMT)
committerKeith Isdale <keith.isdale@nokia.com>2009-08-24 05:28:07 (GMT)
commitfefd6e45962ac915fe9cd43b245642985c36b36d (patch)
tree4d0694fcb0720d493b7bb4995533865535c32675 /src/scripttools/debugging
parent6c282e096c160ef0426466042bf4bb4e0e28f0b2 (diff)
downloadQt-fefd6e45962ac915fe9cd43b245642985c36b36d.zip
Qt-fefd6e45962ac915fe9cd43b245642985c36b36d.tar.gz
Qt-fefd6e45962ac915fe9cd43b245642985c36b36d.tar.bz2
Make assorted constructors follow good coding practice
Ensure that class members are initialized Moved some value assignment from constructor body into the the constructor's intializer list Reviewed-by: Jason McDonald
Diffstat (limited to 'src/scripttools/debugging')
-rw-r--r--src/scripttools/debugging/qscriptcompletiontask.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebugger.cpp2
-rw-r--r--src/scripttools/debugging/qscriptdebuggeragent.cpp8
-rw-r--r--src/scripttools/debugging/qscriptdebuggerbackend.cpp13
-rw-r--r--src/scripttools/debugging/qscriptdebuggerevent.cpp1
-rw-r--r--src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp2
6 files changed, 14 insertions, 13 deletions
diff --git a/src/scripttools/debugging/qscriptcompletiontask.cpp b/src/scripttools/debugging/qscriptcompletiontask.cpp
index a1256a9..59817e1 100644
--- a/src/scripttools/debugging/qscriptcompletiontask.cpp
+++ b/src/scripttools/debugging/qscriptcompletiontask.cpp
@@ -76,6 +76,7 @@ public:
};
QScriptCompletionTaskPrivate::QScriptCompletionTaskPrivate()
+ : cursorPosition(0), frameIndex(0), frontend(0), console(0)
{
}
diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp
index 75ab2f7..68fea05 100644
--- a/src/scripttools/debugging/qscriptdebugger.cpp
+++ b/src/scripttools/debugging/qscriptdebugger.cpp
@@ -1013,7 +1013,7 @@ class SyncBreakpointsJob : public QScriptDebuggerCommandSchedulerJob
public:
SyncBreakpointsJob(QScriptDebuggerPrivate *debugger)
: QScriptDebuggerCommandSchedulerJob(debugger),
- m_debugger(debugger) {}
+ m_debugger(debugger), m_index(-1) {}
void start()
{
QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this);
diff --git a/src/scripttools/debugging/qscriptdebuggeragent.cpp b/src/scripttools/debugging/qscriptdebuggeragent.cpp
index a263f8a..febd975 100644
--- a/src/scripttools/debugging/qscriptdebuggeragent.cpp
+++ b/src/scripttools/debugging/qscriptdebuggeragent.cpp
@@ -61,11 +61,11 @@ QT_BEGIN_NAMESPACE
*/
QScriptDebuggerAgentPrivate::QScriptDebuggerAgentPrivate()
+ : state(NoState), stepDepth(0), stepCount(0),
+ targetScriptId(-1), targetLineNumber(-1), returnCounter(0),
+ nextBreakpointId(1), hitBreakpointId(0),
+ nextContextId(0), statementCounter(0)
{
- state = NoState;
- nextBreakpointId = 1;
- nextContextId = 0;
- statementCounter = 0;
}
QScriptDebuggerAgentPrivate::~QScriptDebuggerAgentPrivate()
diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
index 4d492cf..afb6231 100644
--- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp
@@ -131,14 +131,13 @@ private:
QScriptDebuggerBackendPrivate::QScriptDebuggerBackendPrivate()
+ : agent(0), commandExecutor(0),
+ pendingEvaluateContextIndex(-1), pendingEvaluateLineNumber(-1),
+ ignoreExceptions(false),
+ nextScriptValueIteratorId(0), nextScriptObjectSnapshotId(0),
+ eventReceiver(0),
+ q_ptr(0) // q_ptr will be set later by QScriptDebuggerBackend constructor
{
- eventReceiver = 0;
- agent = 0;
- commandExecutor = 0;
- pendingEvaluateLineNumber = -1;
- ignoreExceptions = false;
- nextScriptValueIteratorId = 0;
- nextScriptObjectSnapshotId = 0;
}
QScriptDebuggerBackendPrivate::~QScriptDebuggerBackendPrivate()
diff --git a/src/scripttools/debugging/qscriptdebuggerevent.cpp b/src/scripttools/debugging/qscriptdebuggerevent.cpp
index ce08c9d..857b09a 100644
--- a/src/scripttools/debugging/qscriptdebuggerevent.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerevent.cpp
@@ -60,6 +60,7 @@ public:
};
QScriptDebuggerEventPrivate::QScriptDebuggerEventPrivate()
+ : type(QScriptDebuggerEvent::None)
{
}
diff --git a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp
index b8088e1..d66ea39 100644
--- a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp
@@ -367,7 +367,7 @@ class QScriptDebuggerScriptedConsoleCommandJobPrivate
: public QScriptDebuggerConsoleCommandJobPrivate
{
public:
- QScriptDebuggerScriptedConsoleCommandJobPrivate() {}
+ QScriptDebuggerScriptedConsoleCommandJobPrivate() : command(0), commandCount(0) {}
~QScriptDebuggerScriptedConsoleCommandJobPrivate() {}
QScriptDebuggerScriptedConsoleCommandPrivate *command;