RemoteLinux: Drop stopRequested from GenericDirectUploadService

It can never be true. And there is another stopRequested in
AbstractRemotelinuxDeployService.

Change-Id: If30b0732f87ddbe573112334a1e4ce719614edfc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-10-11 10:01:07 +02:00
parent 167491c0e7
commit 341f978969

View File

@@ -50,11 +50,10 @@ class GenericDirectUploadServicePrivate
{ {
public: public:
GenericDirectUploadServicePrivate() GenericDirectUploadServicePrivate()
: incremental(false), ignoreMissingFiles(false), stopRequested(false), state(Inactive) {} : incremental(false), ignoreMissingFiles(false), state(Inactive) {}
bool incremental; bool incremental;
bool ignoreMissingFiles; bool ignoreMissingFiles;
bool stopRequested;
State state; State state;
QList<DeployableFile> filesToUpload; QList<DeployableFile> filesToUpload;
SftpChannel::Ptr uploader; SftpChannel::Ptr uploader;
@@ -132,12 +131,6 @@ void GenericDirectUploadService::handleSftpInitialized()
{ {
QTC_ASSERT(d->state == InitializingSftp, setFinished(); return); QTC_ASSERT(d->state == InitializingSftp, setFinished(); return);
if (d->stopRequested) {
setFinished();
handleDeploymentDone();
return;
}
Q_ASSERT(!d->filesToUpload.isEmpty()); Q_ASSERT(!d->filesToUpload.isEmpty());
connect(d->uploader.data(), &SftpChannel::finished, connect(d->uploader.data(), &SftpChannel::finished,
this, &GenericDirectUploadService::handleUploadFinished); this, &GenericDirectUploadService::handleUploadFinished);
@@ -160,11 +153,6 @@ void GenericDirectUploadService::handleUploadFinished(SftpJobId jobId, const QSt
QTC_ASSERT(d->state == Uploading, setFinished(); return); QTC_ASSERT(d->state == Uploading, setFinished(); return);
if (d->stopRequested) {
setFinished();
handleDeploymentDone();
}
const DeployableFile df = d->filesToUpload.takeFirst(); const DeployableFile df = d->filesToUpload.takeFirst();
if (!errorMsg.isEmpty()) { if (!errorMsg.isEmpty()) {
QString errorString = tr("Upload of file \"%1\" failed. The server said: \"%2\".") QString errorString = tr("Upload of file \"%1\" failed. The server said: \"%2\".")
@@ -204,11 +192,6 @@ void GenericDirectUploadService::handleLnFinished(int exitStatus)
{ {
QTC_ASSERT(d->state == Uploading, setFinished(); return); QTC_ASSERT(d->state == Uploading, setFinished(); return);
if (d->stopRequested) {
setFinished();
handleDeploymentDone();
}
const DeployableFile df = d->filesToUpload.takeFirst(); const DeployableFile df = d->filesToUpload.takeFirst();
const QString nativePath = df.localFilePath().toUserOutput(); const QString nativePath = df.localFilePath().toUserOutput();
if (exitStatus != SshRemoteProcess::NormalExit || d->lnProc->exitCode() != 0) { if (exitStatus != SshRemoteProcess::NormalExit || d->lnProc->exitCode() != 0) {
@@ -226,12 +209,6 @@ void GenericDirectUploadService::handleChmodFinished(int exitStatus)
{ {
QTC_ASSERT(d->state == Uploading, setFinished(); return); QTC_ASSERT(d->state == Uploading, setFinished(); return);
if (d->stopRequested) {
setFinished();
handleDeploymentDone();
return;
}
if (exitStatus != SshRemoteProcess::NormalExit || d->chmodProc->exitCode() != 0) { if (exitStatus != SshRemoteProcess::NormalExit || d->chmodProc->exitCode() != 0) {
emit errorMessage(tr("Failed to set executable flag.")); emit errorMessage(tr("Failed to set executable flag."));
setFinished(); setFinished();
@@ -245,11 +222,6 @@ void GenericDirectUploadService::handleMkdirFinished(int exitStatus)
{ {
QTC_ASSERT(d->state == Uploading, setFinished(); return); QTC_ASSERT(d->state == Uploading, setFinished(); return);
if (d->stopRequested) {
setFinished();
handleDeploymentDone();
}
const DeployableFile &df = d->filesToUpload.first(); const DeployableFile &df = d->filesToUpload.first();
QFileInfo fi = df.localFilePath().toFileInfo(); QFileInfo fi = df.localFilePath().toFileInfo();
const QString nativePath = df.localFilePath().toUserOutput(); const QString nativePath = df.localFilePath().toUserOutput();
@@ -351,7 +323,6 @@ void GenericDirectUploadService::checkDeploymentNeeded(const DeployableFile &dep
void GenericDirectUploadService::setFinished() void GenericDirectUploadService::setFinished()
{ {
d->stopRequested = false;
d->state = Inactive; d->state = Inactive;
if (d->mkdirProc) if (d->mkdirProc)
disconnect(d->mkdirProc.data(), 0, this, 0); disconnect(d->mkdirProc.data(), 0, this, 0);