debugger: move SnapshotHandler to DebuggerPluginPrivate

This commit is contained in:
hjk
2010-07-20 17:36:20 +02:00
parent 063ae8ad97
commit cc131beb61
3 changed files with 9 additions and 13 deletions

View File

@@ -1016,6 +1016,7 @@ public:
DebuggerPlugin *m_plugin; DebuggerPlugin *m_plugin;
QList<QPointer<DebuggerRunControl> > m_allRunControls; QList<QPointer<DebuggerRunControl> > m_allRunControls;
SnapshotHandler *m_snapshotHandler;
}; };
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
@@ -1055,6 +1056,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
m_debugMode = 0; m_debugMode = 0;
m_uiSwitcher = 0; m_uiSwitcher = 0;
m_state = DebuggerNotReady; m_state = DebuggerNotReady;
m_snapshotHandler = 0;
} }
bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *errorMessage) bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *errorMessage)
@@ -1108,7 +1110,10 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
// Session related data // Session related data
m_sessionEngine = new SessionEngine; m_sessionEngine = new SessionEngine;
m_snapshotWindow->setModel(m_sessionEngine->m_snapshotHandler->model());
// Snapshot
m_snapshotHandler = new SnapshotHandler(m_sessionEngine);
m_snapshotWindow->setModel(m_snapshotHandler->model());
// Debug mode setup // Debug mode setup
m_debugMode = new DebugMode(this); m_debugMode = new DebugMode(this);
@@ -2701,13 +2706,13 @@ void DebuggerPlugin::createNewDock(QWidget *widget)
void DebuggerPlugin::runControlStarted(DebuggerRunControl *runControl) void DebuggerPlugin::runControlStarted(DebuggerRunControl *runControl)
{ {
d->connectEngine(runControl->engine()); d->connectEngine(runControl->engine());
d->m_sessionEngine->m_snapshotHandler->appendSnapshot(runControl); d->m_snapshotHandler->appendSnapshot(runControl);
} }
void DebuggerPlugin::runControlFinished(DebuggerRunControl *runControl) void DebuggerPlugin::runControlFinished(DebuggerRunControl *runControl)
{ {
Q_UNUSED(runControl); Q_UNUSED(runControl);
d->m_sessionEngine->m_snapshotHandler->removeSnapshot(runControl); d->m_snapshotHandler->removeSnapshot(runControl);
d->disconnectEngine(); d->disconnectEngine();
} }

View File

@@ -28,7 +28,6 @@
**************************************************************************/ **************************************************************************/
#include "sessionengine.h" #include "sessionengine.h"
#include "snapshothandler.h"
#include "breakhandler.h" #include "breakhandler.h"
#include "watchhandler.h" #include "watchhandler.h"
@@ -39,8 +38,7 @@ namespace Internal {
// started during a session. // started during a session.
SessionEngine::SessionEngine() SessionEngine::SessionEngine()
: DebuggerEngine(DebuggerStartParameters()), : DebuggerEngine(DebuggerStartParameters())
m_snapshotHandler(new SnapshotHandler(this))
{ {
} }

View File

@@ -35,8 +35,6 @@
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class SnapshotHandler;
// This class contains data serving as a template for debugger engines // This class contains data serving as a template for debugger engines
// started during a session. // started during a session.
@@ -57,11 +55,6 @@ public:
void loadSessionData(); void loadSessionData();
void saveSessionData(); void saveSessionData();
public:
// The global set of snapshots.
SnapshotHandler *m_snapshotHandler;
// The model serving as command dispatcher.
}; };