forked from qt-creator/qt-creator
RemoteLinux: Make missing target path non-fatal.
There might be e.g. subprojects in a SUBDIRS project that are not supposed to be deployed. Let's support this without forcing people to use CONFIG variables, but emit a big fat warning. Change-Id: I17c9337cecbf68c632ce925fa9a53655dcfaba64 Reviewed-on: http://codereview.qt-project.org/5801 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -75,6 +75,7 @@ public:
|
||||
signals:
|
||||
void errorMessage(const QString &message);
|
||||
void progressMessage(const QString &message);
|
||||
void warningMessage(const QString &message);
|
||||
void stdOutData(const QString &data);
|
||||
void stdErrData(const QString &data);
|
||||
|
||||
|
||||
@@ -95,7 +95,9 @@ bool AbstractRemoteLinuxDeployStep::isDeploymentPossible(QString *whyNot) const
|
||||
void AbstractRemoteLinuxDeployStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
connect(deployService(), SIGNAL(errorMessage(QString)), SLOT(handleErrorMessage(QString)));
|
||||
connect(deployService(), SIGNAL(progressMessage(QString)), SLOT(handleProgressMessage(QString)));
|
||||
connect(deployService(), SIGNAL(progressMessage(QString)),
|
||||
SLOT(handleProgressMessage(QString)));
|
||||
connect(deployService(), SIGNAL(warningMessage(QString)), SLOT(handleWarningMessage(QString)));
|
||||
connect(deployService(), SIGNAL(stdOutData(QString)), SLOT(handleStdOutData(QString)));
|
||||
connect(deployService(), SIGNAL(stdErrData(QString)), SLOT(handleStdErrData(QString)));
|
||||
connect(deployService(), SIGNAL(finished()), SLOT(handleFinished()));
|
||||
@@ -132,11 +134,19 @@ void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message
|
||||
|
||||
void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message)
|
||||
{
|
||||
emit addOutput(message, ErrorMessageOutput);
|
||||
emit addTask(Task(Task::Error, message, QString(), -1,
|
||||
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
d->hasError = true;
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message)
|
||||
{
|
||||
emit addOutput(message, ErrorMessageOutput);
|
||||
emit addTask(Task(Task::Warning, message, QString(), -1,
|
||||
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxDeployStep::handleFinished()
|
||||
{
|
||||
if (d->hasError)
|
||||
|
||||
@@ -72,6 +72,7 @@ protected:
|
||||
private slots:
|
||||
void handleProgressMessage(const QString &message);
|
||||
void handleErrorMessage(const QString &message);
|
||||
void handleWarningMessage(const QString &message);
|
||||
void handleFinished();
|
||||
void handleStdOutData(const QString &data);
|
||||
void handleStdErrData(const QString &data);
|
||||
|
||||
@@ -86,23 +86,6 @@ 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();
|
||||
@@ -328,6 +311,14 @@ void GenericDirectUploadService::uploadNextFile()
|
||||
|
||||
const DeployableFile &df = d->filesToUpload.first();
|
||||
QString dirToCreate = df.remoteDir;
|
||||
if (dirToCreate.isEmpty()) {
|
||||
emit warningMessage(tr("Warning: No remote path set for local file '%1'. Skipping upload.")
|
||||
.arg(QDir::toNativeSeparators(df.localFilePath)));
|
||||
d->filesToUpload.takeFirst();
|
||||
uploadNextFile();
|
||||
return;
|
||||
}
|
||||
|
||||
QFileInfo fi(df.localFilePath);
|
||||
if (fi.isDir())
|
||||
dirToCreate += QLatin1Char('/') + fi.fileName();
|
||||
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
void setIncrementalDeployment(bool incremental);
|
||||
|
||||
protected:
|
||||
bool isDeploymentPossible(QString *whyNot) const;
|
||||
bool isDeploymentNecessary() const;
|
||||
|
||||
void doDeviceSetup();
|
||||
|
||||
Reference in New Issue
Block a user