forked from qt-creator/qt-creator
RemoteLinux: Replace RemoteLinuxDeployConfiguration
... by base DeployConfiguration and adapt remaining users. Change-Id: I6e2a0ab0c9b682b221de0089f8768b5e621e0025 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -110,11 +110,6 @@ void AbstractRemoteLinuxDeployStep::cancel()
|
||||
deployService()->stop();
|
||||
}
|
||||
|
||||
RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfiguration() const
|
||||
{
|
||||
return qobject_cast<RemoteLinuxDeployConfiguration *>(BuildStep::deployConfiguration());
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message)
|
||||
{
|
||||
emit addOutput(message, OutputFormat::NormalMessage);
|
||||
|
@@ -33,7 +33,6 @@
|
||||
|
||||
namespace RemoteLinux {
|
||||
class AbstractRemoteLinuxDeployService;
|
||||
class RemoteLinuxDeployConfiguration;
|
||||
|
||||
namespace Internal { class AbstractRemoteLinuxDeployStepPrivate; }
|
||||
|
||||
@@ -48,7 +47,6 @@ public:
|
||||
bool init() override;
|
||||
void run(QFutureInterface<bool> &fi) override;
|
||||
void cancel() override;
|
||||
RemoteLinuxDeployConfiguration *deployConfiguration() const;
|
||||
|
||||
virtual AbstractRemoteLinuxDeployService *deployService() const = 0;
|
||||
|
||||
|
@@ -45,11 +45,7 @@ namespace RemoteLinux {
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
RemoteLinuxDeployConfiguration::RemoteLinuxDeployConfiguration(Target *target, Core::Id id)
|
||||
: DeployConfiguration(target, id)
|
||||
{}
|
||||
|
||||
Core::Id RemoteLinuxDeployConfiguration::genericDeployConfigurationId()
|
||||
Core::Id genericDeployConfigurationId()
|
||||
{
|
||||
return "DeployToGenericLinux";
|
||||
}
|
||||
@@ -58,8 +54,7 @@ namespace Internal {
|
||||
|
||||
RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory()
|
||||
{
|
||||
registerDeployConfiguration<RemoteLinuxDeployConfiguration>
|
||||
(RemoteLinuxDeployConfiguration::genericDeployConfigurationId());
|
||||
registerDeployConfiguration<DeployConfiguration>(genericDeployConfigurationId());
|
||||
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
|
||||
setDefaultDisplayName(QCoreApplication::translate("RemoteLinux",
|
||||
"Deploy to Remote Linux Host"));
|
||||
|
@@ -32,28 +32,7 @@
|
||||
|
||||
namespace RemoteLinux {
|
||||
|
||||
class REMOTELINUX_EXPORT RemoteLinuxDeployConfiguration
|
||||
: public ProjectExplorer::DeployConfiguration
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
||||
|
||||
static Core::Id genericDeployConfigurationId();
|
||||
|
||||
template<class T> T *earlierBuildStep(const ProjectExplorer::BuildStep *laterBuildStep) const
|
||||
{
|
||||
const QList<ProjectExplorer::BuildStep *> &buildSteps = stepList()->steps();
|
||||
for (int i = 0; i < buildSteps.count(); ++i) {
|
||||
if (buildSteps.at(i) == laterBuildStep)
|
||||
return 0;
|
||||
if (T * const step = dynamic_cast<T *>(buildSteps.at(i)))
|
||||
return step;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
Core::Id genericDeployConfigurationId();
|
||||
|
||||
namespace Internal {
|
||||
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
{
|
||||
registerStep<Step>(Step::stepId());
|
||||
setDisplayName(Step::displayName());
|
||||
setSupportedConfiguration(RemoteLinuxDeployConfiguration::genericDeployConfigurationId());
|
||||
setSupportedConfiguration(genericDeployConfigurationId());
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
||||
}
|
||||
};
|
||||
|
@@ -71,8 +71,14 @@ UploadAndInstallTarPackageStep::UploadAndInstallTarPackageStep(BuildStepList *bs
|
||||
|
||||
bool UploadAndInstallTarPackageStep::initInternal(QString *error)
|
||||
{
|
||||
const TarPackageCreationStep * const pStep
|
||||
= deployConfiguration()->earlierBuildStep<TarPackageCreationStep>(this);
|
||||
const TarPackageCreationStep *pStep = nullptr;
|
||||
|
||||
for (BuildStep *step : deployConfiguration()->stepList()->steps()) {
|
||||
if (step == this)
|
||||
break;
|
||||
if ((pStep = dynamic_cast<TarPackageCreationStep *>(step)))
|
||||
break;
|
||||
}
|
||||
if (!pStep) {
|
||||
if (error)
|
||||
*error = tr("No tarball creation step found.");
|
||||
|
Reference in New Issue
Block a user