RemoteLinux: Deployment improvements.

- Don't depend on the order of signal connections when updating the
deploy step label.
- Give a meaningful error message when the init() function fails.
- Don't try to upload files that don't have a target path set.

Change-Id: If302cf8407b69faf8507579267afde7428edf704
Reviewed-on: http://codereview.qt-project.org/5404
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2011-09-22 17:37:05 +02:00
parent 11f7dbda77
commit 76176a8336
4 changed files with 27 additions and 3 deletions

View File

@@ -78,7 +78,11 @@ QVariantMap AbstractRemoteLinuxDeployStep::toMap() const
bool AbstractRemoteLinuxDeployStep::init() bool AbstractRemoteLinuxDeployStep::init()
{ {
return isDeploymentPossible(); QString error;
const bool canDeploy = isDeploymentPossible(&error);
if (!canDeploy)
emit addOutput(tr("Deployment failed: %1").arg(error), ErrorMessageOutput);
return canDeploy;
} }
bool AbstractRemoteLinuxDeployStep::isDeploymentPossible(QString *whyNot) const bool AbstractRemoteLinuxDeployStep::isDeploymentPossible(QString *whyNot) const

View File

@@ -86,6 +86,23 @@ void GenericDirectUploadService::setIncrementalDeployment(bool incremental)
d->incremental = incremental; d->incremental = incremental;
} }
bool GenericDirectUploadService::isDeploymentPossible(QString *whyNot) const
{
if (!AbstractRemoteLinuxDeployService::isDeploymentPossible(whyNot))
return false;
foreach (const DeployableFile &df, d->deployableFiles) {
if (df.remoteDir.isEmpty()) { // Can happen with targets.
if (whyNot) {
*whyNot = tr("Don't know where to deploy local file '%1'.")
.arg(QFileInfo(df.localFilePath).fileName());
}
return false;
}
}
return true;
}
bool GenericDirectUploadService::isDeploymentNecessary() const bool GenericDirectUploadService::isDeploymentNecessary() const
{ {
d->filesToUpload.clear(); d->filesToUpload.clear();

View File

@@ -64,6 +64,7 @@ private slots:
void handleStdErrData(const QByteArray &data); void handleStdErrData(const QByteArray &data);
private: private:
bool isDeploymentPossible(QString *whyNot) const;
bool isDeploymentNecessary() const; bool isDeploymentNecessary() const;
void doDeviceSetup(); void doDeviceSetup();

View File

@@ -32,6 +32,7 @@
#include "remotelinuxdeploystepwidget.h" #include "remotelinuxdeploystepwidget.h"
#include "abstractremotelinuxdeploystep.h" #include "abstractremotelinuxdeploystep.h"
#include "deploymentinfo.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include "remotelinuxutils.h" #include "remotelinuxutils.h"
@@ -55,11 +56,12 @@ RemoteLinuxDeployStepWidget::RemoteLinuxDeployStepWidget(AbstractRemoteLinuxDepl
SLOT(handleStepToBeRemoved(int))); SLOT(handleStepToBeRemoved(int)));
// TODO: Move this knowledge into the deploy step itself. // TODO: Move this knowledge into the deploy step itself.
connect(qobject_cast<Qt4Project *>(m_step->target()->project()), connect(qobject_cast<Qt4Project *>(m_step->target()->project()), SIGNAL(proParsingDone()),
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *, bool, bool)),
SIGNAL(updateSummary())); SIGNAL(updateSummary()));
connect(m_step->deployConfiguration(), SIGNAL(currentDeviceConfigurationChanged()), connect(m_step->deployConfiguration(), SIGNAL(currentDeviceConfigurationChanged()),
SIGNAL(updateSummary())); SIGNAL(updateSummary()));
connect(m_step->deployConfiguration()->deploymentInfo().data(), SIGNAL(modelReset()),
SIGNAL(updateSummary()));
} }
RemoteLinuxDeployStepWidget::~RemoteLinuxDeployStepWidget() RemoteLinuxDeployStepWidget::~RemoteLinuxDeployStepWidget()