forked from qt-creator/qt-creator
RemoteLinux/Boot2Qt: Merge DeployStep and DeployService hierarchies
They were 1:1 now. The change here is as small as possible, there are quite a few places to clean up left. Change-Id: I4f78d1de857b93d8372e2592a7723b02fe2fc947 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -20,10 +20,21 @@ using namespace Utils::Tasking;
|
||||
|
||||
namespace RemoteLinux::Internal {
|
||||
|
||||
class KillAppService : public AbstractRemoteLinuxDeployService
|
||||
class KillAppStep : public AbstractRemoteLinuxDeployStep
|
||||
{
|
||||
public:
|
||||
void setRemoteExecutable(const FilePath &filePath) { m_remoteExecutable = filePath; }
|
||||
KillAppStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id)
|
||||
{
|
||||
setWidgetExpandedByDefault(false);
|
||||
|
||||
setInternalInitializer([this] {
|
||||
Target * const theTarget = target();
|
||||
QTC_ASSERT(theTarget, return CheckResult::failure());
|
||||
RunConfiguration * const rc = theTarget->activeRunConfiguration();
|
||||
m_remoteExecutable = rc ? rc->runnable().command.executable() : FilePath();
|
||||
return CheckResult::success();
|
||||
});
|
||||
}
|
||||
|
||||
private:
|
||||
bool isDeploymentNecessary() const final { return !m_remoteExecutable.isEmpty(); }
|
||||
@@ -32,7 +43,7 @@ private:
|
||||
FilePath m_remoteExecutable;
|
||||
};
|
||||
|
||||
Group KillAppService::deployRecipe()
|
||||
Group KillAppStep::deployRecipe()
|
||||
{
|
||||
const auto setupHandler = [this](DeviceProcessKiller &killer) {
|
||||
killer.setProcessPath(m_remoteExecutable);
|
||||
@@ -49,27 +60,6 @@ Group KillAppService::deployRecipe()
|
||||
return Group { Killer(setupHandler, doneHandler, errorHandler) };
|
||||
}
|
||||
|
||||
class KillAppStep : public AbstractRemoteLinuxDeployStep
|
||||
{
|
||||
public:
|
||||
KillAppStep(BuildStepList *bsl, Id id) : AbstractRemoteLinuxDeployStep(bsl, id)
|
||||
{
|
||||
auto service = new Internal::KillAppService;
|
||||
setDeployService(service);
|
||||
|
||||
setWidgetExpandedByDefault(false);
|
||||
|
||||
setInternalInitializer([this, service] {
|
||||
Target * const theTarget = target();
|
||||
QTC_ASSERT(theTarget, return CheckResult::failure());
|
||||
RunConfiguration * const rc = theTarget->activeRunConfiguration();
|
||||
const FilePath remoteExe = rc ? rc->runnable().command.executable() : FilePath();
|
||||
service->setRemoteExecutable(remoteExe);
|
||||
return CheckResult::success();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
KillAppStepFactory::KillAppStepFactory()
|
||||
{
|
||||
registerStep<KillAppStep>(Constants::KillAppStepId);
|
||||
|
||||
Reference in New Issue
Block a user