From 6da1403543eda6e11bbd71283a769b28cba55141 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 20 Jan 2016 14:50:34 +0100 Subject: [PATCH] ProjectExplorer: Let a RunConfiguration specify a Runnable. The (target specific) RunConfiguationFactory can specify what it considers a Runnable for the target. The (also target specific) RunControlFactory can use that either unmodified or tweak it to set up a RunControl, (and finally, target specific code runs it). So this still keeps the target code in full control on what is passed where, but reduces the need for boilerplate in the cases where the produced and consumed Runnables are the same (or similar). Change-Id: Ied59430462f4a45ad0006a99c1efd8b07cd181b2 Reviewed-by: Tobias Hunger --- .../projectexplorer/runconfiguration.cpp | 28 +++++++++++++++++++ .../projectexplorer/runconfiguration.h | 1 + 2 files changed, 29 insertions(+) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index c89c699b736..e59714b63a2 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -361,6 +361,34 @@ IRunConfigurationAspect *RunConfiguration::extraAspect(Core::Id id) const return 0; } +/*! + \internal + + \class ProjectExplorer::Runnable + + \brief The ProjectExplorer::Runnable class wraps information needed + to execute a process on a target device. + + A target specific \l RunConfiguration implementation can specify + what information it considers necessary to execute a process + on the target. Target specific) \n IRunControlFactory implementation + can use that information either unmodified or tweak it or ignore + it when setting up a RunControl. + + From Qt Creator's core perspective a Runnable object is opaque. +*/ + +/*! + \internal + + \brief Returns a \l Runnable described by this RunConfiguration. +*/ + +Runnable RunConfiguration::runnable() const +{ + return Runnable(); +} + Utils::OutputFormatter *RunConfiguration::createOutputFormatter() const { return new Utils::OutputFormatter(); diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 55509f34b4e..49336fd17bd 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -251,6 +251,7 @@ public: return 0; } + virtual Runnable runnable() const; virtual Abi abi() const; void addExtraAspects();