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_perspectiveDap{Constants::DAP_PERSPECTIVE_ID, Tr::tr("DAP")};
DebuggerRunWorkerFactory debuggerWorkerFactory;
std::optional<QPoint> attachToUnstartedApplicationDialogLastPosition;
// FIXME: Needed?
@@ -777,6 +775,8 @@ QWidget *DebuggerPluginPrivate::createEngineManagerWindow(BaseTreeView *engineMa
DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
{
setupDebuggerRunWorker();
qRegisterMetaType<ContextData>("ContextData");
qRegisterMetaType<DebuggerRunParameters>("DebuggerRunParameters");
qRegisterMetaType<QString *>();

View File

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

View File

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