forked from qt-creator/qt-creator
RemoteLinux et al: Use functor for deploy step polishing
More compact. Change-Id: I8adc63aec71de1e57640911300f2699598ef1a01 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -40,6 +40,7 @@ class AbstractRemoteLinuxDeployStepPrivate
|
||||
{
|
||||
public:
|
||||
bool hasError;
|
||||
std::function<CheckResult()> internalInit;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -49,6 +50,11 @@ AbstractRemoteLinuxDeployStep::AbstractRemoteLinuxDeployStep(BuildStepList *bsl,
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxDeployStep::setInternalInitializer(const std::function<CheckResult ()> &init)
|
||||
{
|
||||
d->internalInit = init;
|
||||
}
|
||||
|
||||
AbstractRemoteLinuxDeployStep::~AbstractRemoteLinuxDeployStep()
|
||||
{
|
||||
delete d;
|
||||
@@ -70,7 +76,9 @@ QVariantMap AbstractRemoteLinuxDeployStep::toMap() const
|
||||
bool AbstractRemoteLinuxDeployStep::init()
|
||||
{
|
||||
deployService()->setTarget(target());
|
||||
const CheckResult canDeploy = initInternal();
|
||||
|
||||
QTC_ASSERT(d->internalInit, return false);
|
||||
const CheckResult canDeploy = d->internalInit();
|
||||
if (!canDeploy) {
|
||||
emit addOutput(tr("Cannot deploy: %1").arg(canDeploy.errorMessage()),
|
||||
OutputFormat::ErrorMessage);
|
||||
|
||||
Reference in New Issue
Block a user