From 60830e000bce3fefa7d0d3adf15e8d57fb7e9f55 Mon Sep 17 00:00:00 2001 From: Christian Kandeler <christian.kandeler@nokia.com> Date: Wed, 23 Nov 2011 11:55:38 +0100 Subject: [PATCH] RemoteLinux: Rename and unconstify deploy step function. The name "isDeploymentPossible" was misleading, as was the const modifier. Change-Id: Iccaa307133f56ab02a8d6054b0ca9bf660e0d30d Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com> --- .../madde/maddeuploadandinstallpackagesteps.cpp | 16 ++++++++-------- .../madde/maddeuploadandinstallpackagesteps.h | 4 ++-- src/plugins/madde/maemodeploybymountsteps.cpp | 12 ++++++------ src/plugins/madde/maemodeploybymountsteps.h | 4 ++-- .../abstractremotelinuxdeploystep.cpp | 2 +- .../remotelinux/abstractremotelinuxdeploystep.h | 2 +- .../remotelinux/genericdirectuploadstep.cpp | 4 ++-- .../remotelinux/genericdirectuploadstep.h | 2 +- .../remotelinuxcustomcommanddeploymentstep.cpp | 4 ++-- .../remotelinuxcustomcommanddeploymentstep.h | 2 +- .../uploadandinstalltarpackagestep.cpp | 8 ++++---- .../remotelinux/uploadandinstalltarpackagestep.h | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp index 67dbbda4c5..d3789c0967 100644 --- a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp +++ b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp @@ -145,17 +145,17 @@ AbstractRemoteLinuxDeployService *MaemoUploadAndInstallPackageStep::deployServic return m_deployService; } -bool MaemoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const +bool MaemoUploadAndInstallPackageStep::initInternal(QString *error) { const AbstractMaemoPackageCreationStep * const pStep = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this); if (!pStep) { - if (whyNot) - *whyNot = tr("No Debian package creation step found."); + if (error) + *error = tr("No Debian package creation step found."); return false; } m_deployService->setPackageFilePath(pStep->packageFilePath()); - return deployService()->isDeploymentPossible(whyNot); + return deployService()->isDeploymentPossible(error); } QString MaemoUploadAndInstallPackageStep::stepId() @@ -192,17 +192,17 @@ AbstractRemoteLinuxDeployService *MeegoUploadAndInstallPackageStep::deployServic return m_deployService; } -bool MeegoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const +bool MeegoUploadAndInstallPackageStep::initInternal(QString *error) { const AbstractMaemoPackageCreationStep * const pStep = deployConfiguration()->earlierBuildStep<MaemoRpmPackageCreationStep>(this); if (!pStep) { - if (whyNot) - *whyNot = tr("No RPM package creation step found."); + if (error) + *error = tr("No RPM package creation step found."); return false; } m_deployService->setPackageFilePath(pStep->packageFilePath()); - return deployService()->isDeploymentPossible(whyNot); + return deployService()->isDeploymentPossible(error); } QString MeegoUploadAndInstallPackageStep::stepId() diff --git a/src/plugins/madde/maddeuploadandinstallpackagesteps.h b/src/plugins/madde/maddeuploadandinstallpackagesteps.h index de738984c0..3e4b209476 100644 --- a/src/plugins/madde/maddeuploadandinstallpackagesteps.h +++ b/src/plugins/madde/maddeuploadandinstallpackagesteps.h @@ -49,7 +49,7 @@ public: MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl, MaemoUploadAndInstallPackageStep *other); - bool isDeploymentPossible(QString *whyNot = 0) const; + bool initInternal(QString *error = 0); static QString stepId(); static QString displayName(); @@ -71,7 +71,7 @@ public: MeegoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl, MeegoUploadAndInstallPackageStep *other); - bool isDeploymentPossible(QString *whyNot) const; + bool initInternal(QString *error); static QString stepId(); static QString displayName(); diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp index 969daeb184..6faaa7ef1f 100644 --- a/src/plugins/madde/maemodeploybymountsteps.cpp +++ b/src/plugins/madde/maemodeploybymountsteps.cpp @@ -420,17 +420,17 @@ AbstractRemoteLinuxDeployService *MaemoInstallPackageViaMountStep::deployService return m_deployService; } -bool MaemoInstallPackageViaMountStep::isDeploymentPossible(QString *whyNot) const +bool MaemoInstallPackageViaMountStep::initInternal(QString *error) { const AbstractMaemoPackageCreationStep * const pStep = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this); if (!pStep) { - if (whyNot) - *whyNot = tr("No Debian package creation step found."); + if (error) + *error = tr("No Debian package creation step found."); return false; } m_deployService->setPackageFilePath(pStep->packageFilePath()); - return deployService()->isDeploymentPossible(whyNot); + return deployService()->isDeploymentPossible(error); } QString MaemoInstallPackageViaMountStep::stepId() @@ -468,7 +468,7 @@ AbstractRemoteLinuxDeployService *MaemoCopyFilesViaMountStep::deployService() co return m_deployService; } -bool MaemoCopyFilesViaMountStep::isDeploymentPossible(QString *whyNot) const +bool MaemoCopyFilesViaMountStep::initInternal(QString *error) { QList<DeployableFile> deployableFiles; const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo(); @@ -476,7 +476,7 @@ bool MaemoCopyFilesViaMountStep::isDeploymentPossible(QString *whyNot) const for (int i = 0; i < deployableCount; ++i) deployableFiles << deploymentInfo->deployableAt(i); m_deployService->setDeployableFiles(deployableFiles); - return deployService()->isDeploymentPossible(whyNot); + return deployService()->isDeploymentPossible(error); } QString MaemoCopyFilesViaMountStep::stepId() diff --git a/src/plugins/madde/maemodeploybymountsteps.h b/src/plugins/madde/maemodeploybymountsteps.h index 52f3e4eb14..17623a93a0 100644 --- a/src/plugins/madde/maemodeploybymountsteps.h +++ b/src/plugins/madde/maemodeploybymountsteps.h @@ -47,7 +47,7 @@ public: MaemoInstallPackageViaMountStep(ProjectExplorer::BuildStepList *bsl, MaemoInstallPackageViaMountStep *other); - bool isDeploymentPossible(QString *whyNot = 0) const; + bool initInternal(QString *error = 0); static QString stepId(); static QString displayName(); @@ -70,7 +70,7 @@ public: MaemoCopyFilesViaMountStep(ProjectExplorer::BuildStepList *bsl, MaemoCopyFilesViaMountStep *other); - bool isDeploymentPossible(QString *whyNot = 0) const; + bool initInternal(QString *error = 0); static QString stepId(); static QString displayName(); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index 9f3bcabe1b..bdf98dec22 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -82,7 +82,7 @@ bool AbstractRemoteLinuxDeployStep::init() QString error; deployService()->setDeviceConfiguration(deployConfiguration()->deviceConfiguration()); deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration())); - const bool canDeploy = isDeploymentPossible(&error); + const bool canDeploy = initInternal(&error); if (!canDeploy) emit addOutput(tr("Deployment failed: %1").arg(error), ErrorMessageOutput); return canDeploy; diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h index fa4e8323ed..8e96ee9d40 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.h @@ -67,7 +67,7 @@ protected: AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl, AbstractRemoteLinuxDeployStep *other); - virtual bool isDeploymentPossible(QString *whyNot = 0) const = 0; + virtual bool initInternal(QString *error = 0) = 0; private slots: void handleProgressMessage(const QString &message); diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index fe2afb4bd3..8323ce6b07 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -117,7 +117,7 @@ BuildStepConfigWidget *GenericDirectUploadStep::createConfigWidget() return new Internal::ConfigWidget(this); } -bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const +bool GenericDirectUploadStep::initInternal(QString *error) { QList<DeployableFile> deployableFiles; const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo(); @@ -126,7 +126,7 @@ bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const deployableFiles << deploymentInfo->deployableAt(i); deployService()->setDeployableFiles(deployableFiles); deployService()->setIncrementalDeployment(incrementalDeployment()); - return deployService()->isDeploymentPossible(whyNot); + return deployService()->isDeploymentPossible(error); } GenericDirectUploadService *GenericDirectUploadStep::deployService() const diff --git a/src/plugins/remotelinux/genericdirectuploadstep.h b/src/plugins/remotelinux/genericdirectuploadstep.h index b8d7a7799d..5d073d3045 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.h +++ b/src/plugins/remotelinux/genericdirectuploadstep.h @@ -51,7 +51,7 @@ public: ~GenericDirectUploadStep(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); - bool isDeploymentPossible(QString *whyNot = 0) const; + bool initInternal(QString *error = 0); void setIncrementalDeployment(bool incremental); bool incrementalDeployment() const; diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp index d46979dedd..0798243f85 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp @@ -151,10 +151,10 @@ QString AbstractRemoteLinuxCustomCommandDeploymentStep::commandLine() const return d->commandLine; } -bool AbstractRemoteLinuxCustomCommandDeploymentStep::isDeploymentPossible(QString *whyNot) const +bool AbstractRemoteLinuxCustomCommandDeploymentStep::initInternal(QString *error) { deployService()->setCommandLine(d->commandLine); - return deployService()->isDeploymentPossible(whyNot); + return deployService()->isDeploymentPossible(error); } BuildStepConfigWidget *AbstractRemoteLinuxCustomCommandDeploymentStep::createConfigWidget() diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h index 52007045ca..81608d50c2 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h +++ b/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h @@ -61,7 +61,7 @@ protected: AbstractRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, AbstractRemoteLinuxCustomCommandDeploymentStep *other); - bool isDeploymentPossible(QString *whyNot = 0) const; + bool initInternal(QString *error = 0); private: void ctor(); diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp index 5aff8dc4e9..8bc764e962 100644 --- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp +++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.cpp @@ -86,17 +86,17 @@ void UploadAndInstallTarPackageStep::ctor() setDefaultDisplayName(displayName()); } -bool UploadAndInstallTarPackageStep::isDeploymentPossible(QString *whyNot) const +bool UploadAndInstallTarPackageStep::initInternal(QString *error) { const TarPackageCreationStep * const pStep = deployConfiguration()->earlierBuildStep<TarPackageCreationStep>(this); if (!pStep) { - if (whyNot) - *whyNot = tr("No tarball creation step found."); + if (error) + *error = tr("No tarball creation step found."); return false; } m_deployService->setPackageFilePath(pStep->packageFilePath()); - return m_deployService->isDeploymentPossible(whyNot); + return m_deployService->isDeploymentPossible(error); } QString UploadAndInstallTarPackageStep::stepId() diff --git a/src/plugins/remotelinux/uploadandinstalltarpackagestep.h b/src/plugins/remotelinux/uploadandinstalltarpackagestep.h index c489cb39e2..3bcde1b2b3 100644 --- a/src/plugins/remotelinux/uploadandinstalltarpackagestep.h +++ b/src/plugins/remotelinux/uploadandinstalltarpackagestep.h @@ -66,7 +66,7 @@ public: UploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bsl, UploadAndInstallTarPackageStep *other); - bool isDeploymentPossible(QString *whyNot = 0) const; + bool initInternal(QString *error = 0); static QString stepId(); static QString displayName(); -- GitLab