summaryrefslogtreecommitdiffstats
path: root/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-15 14:57:29 +0200
committerKent Hansen <khansen@trolltech.com>2009-06-15 14:58:02 +0200
commitaf090d63ab04ec73c7978ac8e8b3cc312c768c8f (patch)
tree8be882eb0d232fb47473224259c341c20468582a /src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
parent29939818d116ae7fc3bfaa97c4bfa7a3e1ad97ee (diff)
small refactoring
Preparing to make it work with remote debugging.
Diffstat (limited to 'src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp')
-rw-r--r--src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
index e096ba8b00..3226262aa4 100644
--- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
@@ -136,6 +136,7 @@ public:
const QScriptDebuggerValuePropertyList &props);
void deleteObjectSnapshots(const QList<qint64> &snapshotIds);
+ void deleteAllObjectSnapshots();
QScriptDebuggerJobSchedulerInterface *jobScheduler;
QScriptDebuggerCommandSchedulerInterface *commandScheduler;
@@ -151,6 +152,7 @@ QScriptDebuggerLocalsModelPrivate::QScriptDebuggerLocalsModelPrivate()
QScriptDebuggerLocalsModelPrivate::~QScriptDebuggerLocalsModelPrivate()
{
+ deleteAllObjectSnapshots();
delete invisibleRootNode;
}
@@ -240,6 +242,14 @@ void QScriptDebuggerLocalsModelPrivate::deleteObjectSnapshots(const QList<qint64
frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(i));
}
+void QScriptDebuggerLocalsModelPrivate::deleteAllObjectSnapshots()
+{
+ QList<qint64> snapshotIds;
+ for (int i = 0; i < invisibleRootNode->children.count(); ++i)
+ snapshotIds += findSnapshotIdsRecursively(invisibleRootNode->children.at(i));
+ deleteObjectSnapshots(snapshotIds);
+}
+
QScriptDebuggerLocalsModelPrivate *QScriptDebuggerLocalsModelPrivate::get(QScriptDebuggerLocalsModel *q)
{
return q->d_func();
@@ -442,13 +452,6 @@ QScriptDebuggerLocalsModel::QScriptDebuggerLocalsModel(
QScriptDebuggerLocalsModel::~QScriptDebuggerLocalsModel()
{
- Q_D(QScriptDebuggerLocalsModel);
- QList<qint64> snapshotIds;
- for (int i = 0; i < d->invisibleRootNode->children.count(); ++i)
- snapshotIds += findSnapshotIdsRecursively(d->invisibleRootNode->children.at(i));
- QScriptDebuggerCommandSchedulerFrontend frontend(d->commandScheduler, 0);
- for (int j = 0; j < snapshotIds.size(); ++j)
- frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(j));
}
QModelIndex QScriptDebuggerLocalsModelPrivate::addTopLevelObject(const QString &name, const QScriptDebuggerValue &object)