diff options
| author | hjk <hjk@qt.io> | 2024-02-01 14:50:06 +0100 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2024-02-01 14:18:34 +0000 |
| commit | 22886376680e70b8523675b46c33f1cb103a11c5 (patch) | |
| tree | 66ce698b8d50614c815b183f873ba9bf75395000 /src/plugins/python/pythonrunconfiguration.cpp | |
| parent | f94ff4e52435107d6fada6b072b6e05edaf79660 (diff) | |
Python: Use setup functions for run related items
Change-Id: Iefbeda433b0f7eaaf3c429dbc853e0c8578ceb3a
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/python/pythonrunconfiguration.cpp')
| -rw-r--r-- | src/plugins/python/pythonrunconfiguration.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 3c8c600b0aa..d01f4bc9bb7 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -16,13 +16,17 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> +#include <debugger/debuggerruncontrol.h> + #include <extensionsystem/pluginmanager.h> #include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsystem.h> #include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/kitaspects.h> +#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfigurationaspects.h> +#include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> @@ -183,10 +187,34 @@ public: // Factories -PythonRunConfigurationFactory::PythonRunConfigurationFactory() +class PythonRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory +{ +public: + PythonRunConfigurationFactory() + { + registerRunConfiguration<PythonRunConfiguration>(Constants::C_PYTHONRUNCONFIGURATION_ID); + addSupportedProjectType(PythonProjectId); + } +}; + +void setupPythonRunConfiguration() +{ + static PythonRunConfigurationFactory thePythonRunConfigurationFactory; +} + +void setupPythonRunWorker() +{ + static SimpleTargetRunnerFactory thePythonRunWorkerFactory( + {Constants::C_PYTHONRUNCONFIGURATION_ID} + ); +} + +void setupPythonDebugWorker() { - registerRunConfiguration<PythonRunConfiguration>(Constants::C_PYTHONRUNCONFIGURATION_ID); - addSupportedProjectType(PythonProjectId); + static Debugger::SimpleDebugRunnerFactory thePythonDebugRunWorkerFactory( + {Constants::C_PYTHONRUNCONFIGURATION_ID}, + {ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE} + ); } void setupPythonOutputParser() |
