summaryrefslogtreecommitdiff
path: root/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-06-07 16:43:06 +0200
committerhjk <hjk@qt.io>2019-06-11 13:56:55 +0000
commitd747be71f5bff6163ca3c786715f732c997138a4 (patch)
tree7b70b8b5659b954bb04c265acf12258b437a747b /src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
parent00b692e67e5fcfb4946d1da8094b05c9bf5f35ad (diff)
downloadqt-creator-d747be71f5bff6163ca3c786715f732c997138a4.tar.gz
RemoteLinux et al: Use functor for deploy step polishing
More compact. Change-Id: I8adc63aec71de1e57640911300f2699598ef1a01 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
index 87c82e52f8..35a80e005f 100644
--- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
+++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp
@@ -36,7 +36,6 @@ namespace Internal {
class RemoteLinuxCustomCommandDeploymentStepPrivate
{
public:
- BaseStringAspect *commandLineAspect;
RemoteLinuxCustomCommandDeployService service;
};
@@ -46,11 +45,18 @@ RemoteLinuxCustomCommandDeploymentStep::RemoteLinuxCustomCommandDeploymentStep(B
: AbstractRemoteLinuxDeployStep(bsl, stepId())
{
d = new Internal::RemoteLinuxCustomCommandDeploymentStepPrivate;
- d->commandLineAspect = addAspect<BaseStringAspect>();
- d->commandLineAspect->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine");
- d->commandLineAspect->setLabelText(tr("Command line:"));
- d->commandLineAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
+
+ auto commandLine = addAspect<BaseStringAspect>();
+ commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine");
+ commandLine->setLabelText(tr("Command line:"));
+ commandLine->setDisplayStyle(BaseStringAspect::LineEditDisplay);
+
setDefaultDisplayName(displayName());
+
+ setInternalInitializer([this, commandLine] {
+ d->service.setCommandLine(commandLine->value().trimmed());
+ return d->service.isDeploymentPossible();
+ });
}
RemoteLinuxCustomCommandDeploymentStep::~RemoteLinuxCustomCommandDeploymentStep()
@@ -58,12 +64,6 @@ RemoteLinuxCustomCommandDeploymentStep::~RemoteLinuxCustomCommandDeploymentStep(
delete d;
}
-CheckResult RemoteLinuxCustomCommandDeploymentStep::initInternal()
-{
- d->service.setCommandLine(d->commandLineAspect->value().trimmed());
- return d->service.isDeploymentPossible();
-}
-
AbstractRemoteLinuxDeployService *RemoteLinuxCustomCommandDeploymentStep::deployService() const
{
return &d->service;