summaryrefslogtreecommitdiffstats
path: root/src/scripttools
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-15 12:57:29 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-15 12:58:02 (GMT)
commitaf090d63ab04ec73c7978ac8e8b3cc312c768c8f (patch)
tree8be882eb0d232fb47473224259c341c20468582a /src/scripttools
parent29939818d116ae7fc3bfaa97c4bfa7a3e1ad97ee (diff)
downloadQt-af090d63ab04ec73c7978ac8e8b3cc312c768c8f.zip
Qt-af090d63ab04ec73c7978ac8e8b3cc312c768c8f.tar.gz
Qt-af090d63ab04ec73c7978ac8e8b3cc312c768c8f.tar.bz2
small refactoring
Preparing to make it work with remote debugging.
Diffstat (limited to 'src/scripttools')
-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 e096ba8..3226262 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)