diff options
author | hjk <hjk@qt.io> | 2018-09-18 12:52:23 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-09-20 07:13:48 +0000 |
commit | 82688cabd16d8ac054d92e80ed606d5945bf3e3e (patch) | |
tree | 186ae2801d67a248ac47d59396650733f0e656d8 /src/plugins/remotelinux | |
parent | 8dfa977f2fc83ed24358c654ed90936bb066b58a (diff) | |
download | qt-creator-82688cabd16d8ac054d92e80ed606d5945bf3e3e.tar.gz |
RemoteLinux: Merge {Abstract,Generic}RLCustomCommandDeploymentStep
... into a RemoteLinuxCustomCommandDeploymentStep class.
There's only one one incarnation of the abstract base, and neither the
base nor the implementation is really big enough anymore to justify the
hierarchy.
Change-Id: I85759051589482ad48efc0e3cad4679416ceb387
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/remotelinux')
3 files changed, 23 insertions, 67 deletions
diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp index 471ed7579d..67a623a43c 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp @@ -24,6 +24,7 @@ ****************************************************************************/ #include "remotelinuxcustomcommanddeploymentstep.h" +#include "remotelinuxcustomcommanddeployservice.h" #include <projectexplorer/runconfigurationaspects.h> @@ -32,75 +33,53 @@ using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { -class AbstractRemoteLinuxCustomCommandDeploymentStepPrivate +class RemoteLinuxCustomCommandDeploymentStepPrivate { public: BaseStringAspect *commandLineAspect; -}; - -class GenericRemoteLinuxCustomCommandDeploymentStepPrivate -{ -public: RemoteLinuxCustomCommandDeployService service; }; } // namespace Internal -using namespace Internal; - - -AbstractRemoteLinuxCustomCommandDeploymentStep::AbstractRemoteLinuxCustomCommandDeploymentStep - (BuildStepList *bsl, Core::Id id) - : AbstractRemoteLinuxDeployStep(bsl, id) +RemoteLinuxCustomCommandDeploymentStep::RemoteLinuxCustomCommandDeploymentStep(BuildStepList *bsl) + : AbstractRemoteLinuxDeployStep(bsl, stepId()) { - d = new AbstractRemoteLinuxCustomCommandDeploymentStepPrivate; - + d = new Internal::RemoteLinuxCustomCommandDeploymentStepPrivate; d->commandLineAspect = addAspect<BaseStringAspect>(); d->commandLineAspect->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine"); d->commandLineAspect->setLabelText(tr("Command line:")); d->commandLineAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); + setDefaultDisplayName(displayName()); } -AbstractRemoteLinuxCustomCommandDeploymentStep::~AbstractRemoteLinuxCustomCommandDeploymentStep() +RemoteLinuxCustomCommandDeploymentStep::~RemoteLinuxCustomCommandDeploymentStep() { delete d; } -bool AbstractRemoteLinuxCustomCommandDeploymentStep::initInternal(QString *error) +bool RemoteLinuxCustomCommandDeploymentStep::initInternal(QString *error) { - deployService()->setCommandLine(d->commandLineAspect->value().trimmed()); - return deployService()->isDeploymentPossible(error); + d->service.setCommandLine(d->commandLineAspect->value().trimmed()); + return d->service.isDeploymentPossible(error); } -BuildStepConfigWidget *AbstractRemoteLinuxCustomCommandDeploymentStep::createConfigWidget() +BuildStepConfigWidget *RemoteLinuxCustomCommandDeploymentStep::createConfigWidget() { return BuildStep::createConfigWidget(); } - -GenericRemoteLinuxCustomCommandDeploymentStep::GenericRemoteLinuxCustomCommandDeploymentStep(BuildStepList *bsl) - : AbstractRemoteLinuxCustomCommandDeploymentStep(bsl, stepId()) -{ - d = new GenericRemoteLinuxCustomCommandDeploymentStepPrivate; - setDefaultDisplayName(displayName()); -} - -GenericRemoteLinuxCustomCommandDeploymentStep::~GenericRemoteLinuxCustomCommandDeploymentStep() -{ - delete d; -} - -RemoteLinuxCustomCommandDeployService *GenericRemoteLinuxCustomCommandDeploymentStep::deployService() const +AbstractRemoteLinuxDeployService *RemoteLinuxCustomCommandDeploymentStep::deployService() const { return &d->service; } -Core::Id GenericRemoteLinuxCustomCommandDeploymentStep::stepId() +Core::Id RemoteLinuxCustomCommandDeploymentStep::stepId() { return "RemoteLinux.GenericRemoteLinuxCustomCommandDeploymentStep"; } -QString GenericRemoteLinuxCustomCommandDeploymentStep::displayName() +QString RemoteLinuxCustomCommandDeploymentStep::displayName() { return tr("Run custom remote command"); } diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h index d8a740355d..4ba666f8e9 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h @@ -26,50 +26,27 @@ #pragma once #include "abstractremotelinuxdeploystep.h" -#include "remotelinuxcustomcommanddeployservice.h" namespace RemoteLinux { -namespace Internal { -class AbstractRemoteLinuxCustomCommandDeploymentStepPrivate; -class GenericRemoteLinuxCustomCommandDeploymentStepPrivate; -} // namespace Internal +namespace Internal { class RemoteLinuxCustomCommandDeploymentStepPrivate; } - -class REMOTELINUX_EXPORT AbstractRemoteLinuxCustomCommandDeploymentStep +class REMOTELINUX_EXPORT RemoteLinuxCustomCommandDeploymentStep : public AbstractRemoteLinuxDeployStep { Q_OBJECT public: - ~AbstractRemoteLinuxCustomCommandDeploymentStep() override; - -protected: - AbstractRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, Core::Id id); - - bool initInternal(QString *error = 0) override; - -private: - RemoteLinuxCustomCommandDeployService *deployService() const override = 0; - ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; - - Internal::AbstractRemoteLinuxCustomCommandDeploymentStepPrivate *d; -}; - - -class REMOTELINUX_EXPORT GenericRemoteLinuxCustomCommandDeploymentStep - : public AbstractRemoteLinuxCustomCommandDeploymentStep -{ - Q_OBJECT -public: - explicit GenericRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl); - ~GenericRemoteLinuxCustomCommandDeploymentStep() override; + explicit RemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl); + ~RemoteLinuxCustomCommandDeploymentStep() override; static Core::Id stepId(); static QString displayName(); private: - RemoteLinuxCustomCommandDeployService *deployService() const override; + bool initInternal(QString *error) override; + AbstractRemoteLinuxDeployService *deployService() const override; + ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; - Internal::GenericRemoteLinuxCustomCommandDeploymentStepPrivate *d; + Internal::RemoteLinuxCustomCommandDeploymentStepPrivate *d; }; } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 2f67ae25e9..6a5dffa747 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -73,7 +73,7 @@ public: GenericDeployStepFactory<TarPackageCreationStep> tarPackageCreationStepFactory; GenericDeployStepFactory<UploadAndInstallTarPackageStep> uploadAndInstallTarPackageStepFactory; GenericDeployStepFactory<GenericDirectUploadStep> genericDirectUploadStepFactory; - GenericDeployStepFactory<GenericRemoteLinuxCustomCommandDeploymentStep> + GenericDeployStepFactory<RemoteLinuxCustomCommandDeploymentStep> customCommandDeploymentStepFactory; GenericDeployStepFactory<RemoteLinuxCheckForFreeDiskSpaceStep> checkForFreeDiskSpaceStepFactory; |