Commit 76176a83 authored by Christian Kandeler's avatar Christian Kandeler

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/5404Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 11f7dbda
......@@ -78,7 +78,11 @@ QVariantMap AbstractRemoteLinuxDeployStep::toMap() const
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
......
......@@ -86,6 +86,23 @@ void GenericDirectUploadService::setIncrementalDeployment(bool 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
{
d->filesToUpload.clear();
......
......@@ -64,6 +64,7 @@ private slots:
void handleStdErrData(const QByteArray &data);
private:
bool isDeploymentPossible(QString *whyNot) const;
bool isDeploymentNecessary() const;
void doDeviceSetup();
......
......@@ -32,6 +32,7 @@
#include "remotelinuxdeploystepwidget.h"
#include "abstractremotelinuxdeploystep.h"
#include "deploymentinfo.h"
#include "remotelinuxdeployconfiguration.h"
#include "remotelinuxutils.h"
......@@ -55,11 +56,12 @@ RemoteLinuxDeployStepWidget::RemoteLinuxDeployStepWidget(AbstractRemoteLinuxDepl
SLOT(handleStepToBeRemoved(int)));
// TODO: Move this knowledge into the deploy step itself.
connect(qobject_cast<Qt4Project *>(m_step->target()->project()),
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *, bool, bool)),
connect(qobject_cast<Qt4Project *>(m_step->target()->project()), SIGNAL(proParsingDone()),
SIGNAL(updateSummary()));
connect(m_step->deployConfiguration(), SIGNAL(currentDeviceConfigurationChanged()),
SIGNAL(updateSummary()));
connect(m_step->deployConfiguration()->deploymentInfo().data(), SIGNAL(modelReset()),
SIGNAL(updateSummary()));
}
RemoteLinuxDeployStepWidget::~RemoteLinuxDeployStepWidget()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment