diff options
author | hjk <hjk@qt.io> | 2019-06-11 14:39:39 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-06-12 12:30:23 +0000 |
commit | 7ebe005206327d458e8b414b8ccdee1f02a51da6 (patch) | |
tree | 3e3a29365529fdd5184678fdf879f081fcd50f74 /src/plugins/pythoneditor/pythoneditorplugin.cpp | |
parent | a51b8a061e91ed615bd48b348dcc133e01f49dbf (diff) | |
download | qt-creator-7ebe005206327d458e8b414b8ccdee1f02a51da6.tar.gz |
ProjectExplorer: Replace RunConfiguration::executable
... by a RunConfiguration::commandLine().
That's what is typically consumed, and removes the need for some
custom runnable() implementations.
Change-Id: I7700b12cdd0965802a0add977b432314734a5a72
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 9a494b47b0..8dd87ebbda 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -246,7 +246,6 @@ public: private: void doAdditionalSetup(const RunConfigurationCreationInfo &) final { updateTargetInformation(); } - Runnable runnable() const final; bool supportsDebugger() const { return true; } QString mainScript() const { return aspect<MainScriptAspect>()->value(); } @@ -275,12 +274,16 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id) scriptAspect->setDisplayStyle(BaseStringAspect::LabelDisplay); addAspect<LocalEnvironmentAspect>(target); - addAspect<ArgumentsAspect>(); + + auto argumentsAspect = addAspect<ArgumentsAspect>(); + addAspect<TerminalAspect>(); setOutputFormatter<PythonOutputFormatter>(); - setExecutableGetter([this] { - return FilePath::fromString(aspect<InterpreterAspect>()->value()); + setCommandLineGetter([this, interpreterAspect, argumentsAspect] { + CommandLine cmd{FilePath::fromString(interpreterAspect->value()), {mainScript()}}; + cmd.addArgs(argumentsAspect->arguments(macroExpander()), CommandLine::Raw); + return cmd; }); connect(target, &Target::applicationTargetsChanged, @@ -297,17 +300,6 @@ void PythonRunConfiguration::updateTargetInformation() aspect<MainScriptAspect>()->setValue(script); } -Runnable PythonRunConfiguration::runnable() const -{ - CommandLine cmd{executable(), {mainScript()}}; - cmd.addArgs(aspect<ArgumentsAspect>()->arguments(macroExpander()), CommandLine::Raw); - - Runnable r; - r.setCommandLine(cmd); - r.environment = aspect<EnvironmentAspect>()->environment(); - return r; -} - class PythonRunConfigurationFactory : public RunConfigurationFactory { public: |