Debugger: Setup debugger factory in a new style

Change-Id: I946cf03f70b8d6ee727883ea9480529faf8b7cb7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-13 19:52:26 +01:00
parent ec63424386
commit 6731d11628
3 changed files with 22 additions and 19 deletions

View File

@@ -699,8 +699,6 @@ public:
Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")}; Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")};
Perspective m_perspectiveDap{Constants::DAP_PERSPECTIVE_ID, Tr::tr("DAP")}; Perspective m_perspectiveDap{Constants::DAP_PERSPECTIVE_ID, Tr::tr("DAP")};
DebuggerRunWorkerFactory debuggerWorkerFactory;
std::optional<QPoint> attachToUnstartedApplicationDialogLastPosition; std::optional<QPoint> attachToUnstartedApplicationDialogLastPosition;
// FIXME: Needed? // FIXME: Needed?
@@ -777,6 +775,8 @@ QWidget *DebuggerPluginPrivate::createEngineManagerWindow(BaseTreeView *engineMa
DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
{ {
setupDebuggerRunWorker();
qRegisterMetaType<ContextData>("ContextData"); qRegisterMetaType<ContextData>("ContextData");
qRegisterMetaType<DebuggerRunParameters>("DebuggerRunParameters"); qRegisterMetaType<DebuggerRunParameters>("DebuggerRunParameters");
qRegisterMetaType<QString *>(); qRegisterMetaType<QString *>();

View File

@@ -689,10 +689,11 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup()
d->debuggerServerProc.start(); d->debuggerServerProc.start();
} }
// DebuggerRunWorkerFactory class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
DebuggerRunWorkerFactory::DebuggerRunWorkerFactory()
{ {
public:
DebuggerRunWorkerFactory()
{
setProduct<DebuggerRunTool>(); setProduct<DebuggerRunTool>();
setId(Constants::DEBUGGER_RUN_FACTORY); setId(Constants::DEBUGGER_RUN_FACTORY);
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE); addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
@@ -703,6 +704,12 @@ DebuggerRunWorkerFactory::DebuggerRunWorkerFactory()
addSupportedDeviceType("DockerDeviceType"); addSupportedDeviceType("DockerDeviceType");
addSupportForLocalRunConfigs(); addSupportForLocalRunConfigs();
}
};
void setupDebuggerRunWorker()
{
static DebuggerRunWorkerFactory theDebuggerRunWorkerFactory;
} }
} // Debugger } // Debugger

View File

@@ -50,11 +50,7 @@ private:
DebuggerRunParameters m_runParameters; DebuggerRunParameters m_runParameters;
}; };
class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory void setupDebuggerRunWorker();
{
public:
DebuggerRunWorkerFactory();
};
class SimpleDebugRunnerFactory final : public ProjectExplorer::RunWorkerFactory class SimpleDebugRunnerFactory final : public ProjectExplorer::RunWorkerFactory
{ {