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>
This commit is contained in:
Christian Kandeler
2011-11-23 11:55:38 +01:00
parent 7bafb8adfa
commit 60830e000b
12 changed files with 31 additions and 31 deletions

View File

@@ -145,17 +145,17 @@ AbstractRemoteLinuxDeployService *MaemoUploadAndInstallPackageStep::deployServic
return m_deployService; return m_deployService;
} }
bool MaemoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const bool MaemoUploadAndInstallPackageStep::initInternal(QString *error)
{ {
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this); = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (error)
*whyNot = tr("No Debian package creation step found."); *error = tr("No Debian package creation step found.");
return false; return false;
} }
m_deployService->setPackageFilePath(pStep->packageFilePath()); m_deployService->setPackageFilePath(pStep->packageFilePath());
return deployService()->isDeploymentPossible(whyNot); return deployService()->isDeploymentPossible(error);
} }
QString MaemoUploadAndInstallPackageStep::stepId() QString MaemoUploadAndInstallPackageStep::stepId()
@@ -192,17 +192,17 @@ AbstractRemoteLinuxDeployService *MeegoUploadAndInstallPackageStep::deployServic
return m_deployService; return m_deployService;
} }
bool MeegoUploadAndInstallPackageStep::isDeploymentPossible(QString *whyNot) const bool MeegoUploadAndInstallPackageStep::initInternal(QString *error)
{ {
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= deployConfiguration()->earlierBuildStep<MaemoRpmPackageCreationStep>(this); = deployConfiguration()->earlierBuildStep<MaemoRpmPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (error)
*whyNot = tr("No RPM package creation step found."); *error = tr("No RPM package creation step found.");
return false; return false;
} }
m_deployService->setPackageFilePath(pStep->packageFilePath()); m_deployService->setPackageFilePath(pStep->packageFilePath());
return deployService()->isDeploymentPossible(whyNot); return deployService()->isDeploymentPossible(error);
} }
QString MeegoUploadAndInstallPackageStep::stepId() QString MeegoUploadAndInstallPackageStep::stepId()

View File

@@ -49,7 +49,7 @@ public:
MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl, MaemoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl,
MaemoUploadAndInstallPackageStep *other); MaemoUploadAndInstallPackageStep *other);
bool isDeploymentPossible(QString *whyNot = 0) const; bool initInternal(QString *error = 0);
static QString stepId(); static QString stepId();
static QString displayName(); static QString displayName();
@@ -71,7 +71,7 @@ public:
MeegoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl, MeegoUploadAndInstallPackageStep(ProjectExplorer::BuildStepList *bsl,
MeegoUploadAndInstallPackageStep *other); MeegoUploadAndInstallPackageStep *other);
bool isDeploymentPossible(QString *whyNot) const; bool initInternal(QString *error);
static QString stepId(); static QString stepId();
static QString displayName(); static QString displayName();

View File

@@ -420,17 +420,17 @@ AbstractRemoteLinuxDeployService *MaemoInstallPackageViaMountStep::deployService
return m_deployService; return m_deployService;
} }
bool MaemoInstallPackageViaMountStep::isDeploymentPossible(QString *whyNot) const bool MaemoInstallPackageViaMountStep::initInternal(QString *error)
{ {
const AbstractMaemoPackageCreationStep * const pStep const AbstractMaemoPackageCreationStep * const pStep
= deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this); = deployConfiguration()->earlierBuildStep<MaemoDebianPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (error)
*whyNot = tr("No Debian package creation step found."); *error = tr("No Debian package creation step found.");
return false; return false;
} }
m_deployService->setPackageFilePath(pStep->packageFilePath()); m_deployService->setPackageFilePath(pStep->packageFilePath());
return deployService()->isDeploymentPossible(whyNot); return deployService()->isDeploymentPossible(error);
} }
QString MaemoInstallPackageViaMountStep::stepId() QString MaemoInstallPackageViaMountStep::stepId()
@@ -468,7 +468,7 @@ AbstractRemoteLinuxDeployService *MaemoCopyFilesViaMountStep::deployService() co
return m_deployService; return m_deployService;
} }
bool MaemoCopyFilesViaMountStep::isDeploymentPossible(QString *whyNot) const bool MaemoCopyFilesViaMountStep::initInternal(QString *error)
{ {
QList<DeployableFile> deployableFiles; QList<DeployableFile> deployableFiles;
const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo(); const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo();
@@ -476,7 +476,7 @@ bool MaemoCopyFilesViaMountStep::isDeploymentPossible(QString *whyNot) const
for (int i = 0; i < deployableCount; ++i) for (int i = 0; i < deployableCount; ++i)
deployableFiles << deploymentInfo->deployableAt(i); deployableFiles << deploymentInfo->deployableAt(i);
m_deployService->setDeployableFiles(deployableFiles); m_deployService->setDeployableFiles(deployableFiles);
return deployService()->isDeploymentPossible(whyNot); return deployService()->isDeploymentPossible(error);
} }
QString MaemoCopyFilesViaMountStep::stepId() QString MaemoCopyFilesViaMountStep::stepId()

View File

@@ -47,7 +47,7 @@ public:
MaemoInstallPackageViaMountStep(ProjectExplorer::BuildStepList *bsl, MaemoInstallPackageViaMountStep(ProjectExplorer::BuildStepList *bsl,
MaemoInstallPackageViaMountStep *other); MaemoInstallPackageViaMountStep *other);
bool isDeploymentPossible(QString *whyNot = 0) const; bool initInternal(QString *error = 0);
static QString stepId(); static QString stepId();
static QString displayName(); static QString displayName();
@@ -70,7 +70,7 @@ public:
MaemoCopyFilesViaMountStep(ProjectExplorer::BuildStepList *bsl, MaemoCopyFilesViaMountStep(ProjectExplorer::BuildStepList *bsl,
MaemoCopyFilesViaMountStep *other); MaemoCopyFilesViaMountStep *other);
bool isDeploymentPossible(QString *whyNot = 0) const; bool initInternal(QString *error = 0);
static QString stepId(); static QString stepId();
static QString displayName(); static QString displayName();

View File

@@ -82,7 +82,7 @@ bool AbstractRemoteLinuxDeployStep::init()
QString error; QString error;
deployService()->setDeviceConfiguration(deployConfiguration()->deviceConfiguration()); deployService()->setDeviceConfiguration(deployConfiguration()->deviceConfiguration());
deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration())); deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration()));
const bool canDeploy = isDeploymentPossible(&error); const bool canDeploy = initInternal(&error);
if (!canDeploy) if (!canDeploy)
emit addOutput(tr("Deployment failed: %1").arg(error), ErrorMessageOutput); emit addOutput(tr("Deployment failed: %1").arg(error), ErrorMessageOutput);
return canDeploy; return canDeploy;

View File

@@ -67,7 +67,7 @@ protected:
AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl, AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl,
AbstractRemoteLinuxDeployStep *other); AbstractRemoteLinuxDeployStep *other);
virtual bool isDeploymentPossible(QString *whyNot = 0) const = 0; virtual bool initInternal(QString *error = 0) = 0;
private slots: private slots:
void handleProgressMessage(const QString &message); void handleProgressMessage(const QString &message);

View File

@@ -117,7 +117,7 @@ BuildStepConfigWidget *GenericDirectUploadStep::createConfigWidget()
return new Internal::ConfigWidget(this); return new Internal::ConfigWidget(this);
} }
bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const bool GenericDirectUploadStep::initInternal(QString *error)
{ {
QList<DeployableFile> deployableFiles; QList<DeployableFile> deployableFiles;
const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo(); const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo();
@@ -126,7 +126,7 @@ bool GenericDirectUploadStep::isDeploymentPossible(QString *whyNot) const
deployableFiles << deploymentInfo->deployableAt(i); deployableFiles << deploymentInfo->deployableAt(i);
deployService()->setDeployableFiles(deployableFiles); deployService()->setDeployableFiles(deployableFiles);
deployService()->setIncrementalDeployment(incrementalDeployment()); deployService()->setIncrementalDeployment(incrementalDeployment());
return deployService()->isDeploymentPossible(whyNot); return deployService()->isDeploymentPossible(error);
} }
GenericDirectUploadService *GenericDirectUploadStep::deployService() const GenericDirectUploadService *GenericDirectUploadStep::deployService() const

View File

@@ -51,7 +51,7 @@ public:
~GenericDirectUploadStep(); ~GenericDirectUploadStep();
ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
bool isDeploymentPossible(QString *whyNot = 0) const; bool initInternal(QString *error = 0);
void setIncrementalDeployment(bool incremental); void setIncrementalDeployment(bool incremental);
bool incrementalDeployment() const; bool incrementalDeployment() const;

View File

@@ -151,10 +151,10 @@ QString AbstractRemoteLinuxCustomCommandDeploymentStep::commandLine() const
return d->commandLine; return d->commandLine;
} }
bool AbstractRemoteLinuxCustomCommandDeploymentStep::isDeploymentPossible(QString *whyNot) const bool AbstractRemoteLinuxCustomCommandDeploymentStep::initInternal(QString *error)
{ {
deployService()->setCommandLine(d->commandLine); deployService()->setCommandLine(d->commandLine);
return deployService()->isDeploymentPossible(whyNot); return deployService()->isDeploymentPossible(error);
} }
BuildStepConfigWidget *AbstractRemoteLinuxCustomCommandDeploymentStep::createConfigWidget() BuildStepConfigWidget *AbstractRemoteLinuxCustomCommandDeploymentStep::createConfigWidget()

View File

@@ -61,7 +61,7 @@ protected:
AbstractRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, AbstractRemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl,
AbstractRemoteLinuxCustomCommandDeploymentStep *other); AbstractRemoteLinuxCustomCommandDeploymentStep *other);
bool isDeploymentPossible(QString *whyNot = 0) const; bool initInternal(QString *error = 0);
private: private:
void ctor(); void ctor();

View File

@@ -86,17 +86,17 @@ void UploadAndInstallTarPackageStep::ctor()
setDefaultDisplayName(displayName()); setDefaultDisplayName(displayName());
} }
bool UploadAndInstallTarPackageStep::isDeploymentPossible(QString *whyNot) const bool UploadAndInstallTarPackageStep::initInternal(QString *error)
{ {
const TarPackageCreationStep * const pStep const TarPackageCreationStep * const pStep
= deployConfiguration()->earlierBuildStep<TarPackageCreationStep>(this); = deployConfiguration()->earlierBuildStep<TarPackageCreationStep>(this);
if (!pStep) { if (!pStep) {
if (whyNot) if (error)
*whyNot = tr("No tarball creation step found."); *error = tr("No tarball creation step found.");
return false; return false;
} }
m_deployService->setPackageFilePath(pStep->packageFilePath()); m_deployService->setPackageFilePath(pStep->packageFilePath());
return m_deployService->isDeploymentPossible(whyNot); return m_deployService->isDeploymentPossible(error);
} }
QString UploadAndInstallTarPackageStep::stepId() QString UploadAndInstallTarPackageStep::stepId()

View File

@@ -66,7 +66,7 @@ public:
UploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bsl, UploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bsl,
UploadAndInstallTarPackageStep *other); UploadAndInstallTarPackageStep *other);
bool isDeploymentPossible(QString *whyNot = 0) const; bool initInternal(QString *error = 0);
static QString stepId(); static QString stepId();
static QString displayName(); static QString displayName();