summaryrefslogtreecommitdiff
path: root/src/plugins/remotelinux
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-01-18 15:19:59 +0100
committerhjk <hjk@qt.io>2019-01-22 09:33:54 +0000
commit59ac20b8d572f4cc2b80a6809a2da5f863059985 (patch)
tree2fab0a2db56552008146b0fa5555d95053fa9e9a /src/plugins/remotelinux
parenta8d2546dad8d8a05515ff867271e46ebed5841d7 (diff)
downloadqt-creator-59ac20b8d572f4cc2b80a6809a2da5f863059985.tar.gz
RemoteLinux: Replace RemoteLinuxDeployConfiguration
... by base DeployConfiguration and adapt remaining users. Change-Id: I6e2a0ab0c9b682b221de0089f8768b5e621e0025 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/remotelinux')
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp5
-rw-r--r--src/plugins/remotelinux/abstractremotelinuxdeploystep.h2
-rw-r--r--src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp9
-rw-r--r--src/plugins/remotelinux/remotelinuxdeployconfiguration.h23
-rw-r--r--src/plugins/remotelinux/remotelinuxplugin.cpp2
-rw-r--r--src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp10
6 files changed, 12 insertions, 39 deletions
diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp
index 29c310db24..7b578d3c4c 100644
--- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp
+++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp
@@ -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);
diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h
index a52ff4db7c..728c61e1be 100644
--- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h
+++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h
@@ -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;
diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
index ad9147042a..9e8b51ef61 100644
--- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
+++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
@@ -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"));
diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h b/src/plugins/remotelinux/remotelinuxdeployconfiguration.h
index bb99f1f3c8..d3c5974df6 100644
--- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.h
+++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.h
@@ -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 {
diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp
index 273a78f3a1..25b8eb5e89 100644
--- a/src/plugins/remotelinux/remotelinuxplugin.cpp
+++ b/src/plugins/remotelinux/remotelinuxplugin.cpp
@@ -59,7 +59,7 @@ public:
{
registerStep<Step>(Step::stepId());
setDisplayName(Step::displayName());
- setSupportedConfiguration(RemoteLinuxDeployConfiguration::genericDeployConfigurationId());
+ setSupportedConfiguration(genericDeployConfigurationId());
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
}
};
diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp
index 8d163e3a1f..ecc7eb3997 100644
--- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp
+++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp
@@ -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.");