From 7ebe005206327d458e8b414b8ccdee1f02a51da6 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Jun 2019 14:39:39 +0200 Subject: 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 --- src/plugins/pythoneditor/pythoneditorplugin.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp') 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()->value(); } @@ -275,12 +274,16 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id) scriptAspect->setDisplayStyle(BaseStringAspect::LabelDisplay); addAspect(target); - addAspect(); + + auto argumentsAspect = addAspect(); + addAspect(); setOutputFormatter(); - setExecutableGetter([this] { - return FilePath::fromString(aspect()->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()->setValue(script); } -Runnable PythonRunConfiguration::runnable() const -{ - CommandLine cmd{executable(), {mainScript()}}; - cmd.addArgs(aspect()->arguments(macroExpander()), CommandLine::Raw); - - Runnable r; - r.setCommandLine(cmd); - r.environment = aspect()->environment(); - return r; -} - class PythonRunConfigurationFactory : public RunConfigurationFactory { public: -- cgit v1.2.1