diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp index cdecdaf6c63..f4ff1cef251 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.cpp @@ -43,7 +43,7 @@ namespace RemoteLinux { namespace Internal { namespace { -enum State { Inactive, SettingUpDevice, Deploying }; +enum State { Inactive, Deploying }; } // anonymous namespace class AbstractRemoteLinuxDeployServicePrivate @@ -131,8 +131,8 @@ void AbstractRemoteLinuxDeployService::start() return; } - d->state = SettingUpDevice; - doDeviceSetup(); + d->state = Deploying; + doDeploy(); } void AbstractRemoteLinuxDeployService::stop() @@ -140,17 +140,9 @@ void AbstractRemoteLinuxDeployService::stop() if (d->stopRequested) return; - switch (d->state) { - case Inactive: - break; - case SettingUpDevice: - d->stopRequested = true; - stopDeviceSetup(); - break; - case Deploying: + if (d->state == Deploying) { d->stopRequested = true; stopDeployment(); - break; } } @@ -171,19 +163,6 @@ void AbstractRemoteLinuxDeployService::importDeployTimes(const QVariantMap &map) d->deployTimes.importDeployTimes(map); } -void AbstractRemoteLinuxDeployService::handleDeviceSetupDone(bool success) -{ - QTC_ASSERT(d->state == SettingUpDevice, return); - - if (!success || d->stopRequested) { - setFinished(); - return; - } - - d->state = Deploying; - doDeploy(); -} - void AbstractRemoteLinuxDeployService::handleDeploymentDone() { QTC_ASSERT(d->state == Deploying, return); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h index c4192d10a5e..5590d879d03 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeployservice.h +++ b/src/plugins/remotelinux/abstractremotelinuxdeployservice.h @@ -96,13 +96,8 @@ protected: bool hasRemoteFileChanged(const ProjectExplorer::DeployableFile &deployableFile, const QDateTime &remoteTimestamp) const; - void handleDeviceSetupDone(bool success); void handleDeploymentDone(); - // Should do things needed *before* connecting. Call default implementation afterwards. - virtual void doDeviceSetup() { handleDeviceSetupDone(true); } - virtual void stopDeviceSetup() { handleDeviceSetupDone(false); } - void setFinished(); private: diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp index 1326c484301..05c1e3e7269 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp @@ -85,18 +85,6 @@ bool AbstractUploadAndInstallPackageService::isDeploymentNecessary() const return hasLocalFileChanged(DeployableFile(d->packageFilePath, QString())); } -void AbstractUploadAndInstallPackageService::doDeviceSetup() -{ - QTC_ASSERT(d->state == Inactive, return); - AbstractRemoteLinuxDeployService::doDeviceSetup(); -} - -void AbstractUploadAndInstallPackageService::stopDeviceSetup() -{ - QTC_ASSERT(d->state == Inactive, return); - AbstractRemoteLinuxDeployService::stopDeviceSetup(); -} - void AbstractUploadAndInstallPackageService::doDeploy() { QTC_ASSERT(d->state == Inactive, return); diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h index 82d9e6cd175..6cfab8d89ad 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.h @@ -57,8 +57,6 @@ private: virtual QString uploadDir() const; // Defaults to remote user's home directory. bool isDeploymentNecessary() const override; - void doDeviceSetup() override; - void stopDeviceSetup() override; void doDeploy() override; void stopDeployment() override; diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp index 076a9027012..6743657c0d3 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.cpp +++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp @@ -129,18 +129,6 @@ bool GenericDirectUploadService::isDeploymentNecessary() const return !d->deployableFiles.isEmpty(); } -void GenericDirectUploadService::doDeviceSetup() -{ - QTC_ASSERT(d->state == Inactive, return); - AbstractRemoteLinuxDeployService::doDeviceSetup(); -} - -void GenericDirectUploadService::stopDeviceSetup() -{ - QTC_ASSERT(d->state == Inactive, return); - AbstractRemoteLinuxDeployService::stopDeviceSetup(); -} - void GenericDirectUploadService::doDeploy() { QTC_ASSERT(d->state == Inactive, setFinished(); return); diff --git a/src/plugins/remotelinux/genericdirectuploadservice.h b/src/plugins/remotelinux/genericdirectuploadservice.h index be7eda62610..42af64e3823 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.h +++ b/src/plugins/remotelinux/genericdirectuploadservice.h @@ -55,9 +55,6 @@ public: protected: bool isDeploymentNecessary() const override; - void doDeviceSetup() override; - void stopDeviceSetup() override; - void doDeploy() override; void stopDeployment() override; diff --git a/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp b/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp index 2c3650206c6..a332c8183d8 100644 --- a/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp +++ b/src/plugins/remotelinux/remotelinuxcheckforfreediskspacestep.cpp @@ -54,14 +54,11 @@ public: void setRequiredSpaceInBytes(quint64 sizeInBytes); private: - void deployAndFinish(); bool isDeploymentNecessary() const override { return true; } CheckResult isDeploymentPossible() const override; - void doDeviceSetup() final { deployAndFinish(); } - void stopDeviceSetup() final { } - void doDeploy() final {} + void doDeploy() final; void stopDeployment() final {} QString m_pathToCheck; @@ -78,7 +75,7 @@ void RemoteLinuxCheckForFreeDiskSpaceService::setRequiredSpaceInBytes(quint64 si m_requiredSpaceInBytes = sizeInBytes; } -void RemoteLinuxCheckForFreeDiskSpaceService::deployAndFinish() +void RemoteLinuxCheckForFreeDiskSpaceService::doDeploy() { auto cleanup = qScopeGuard([this] { setFinished(); }); const FilePath path = deviceConfiguration()->filePath(m_pathToCheck); @@ -86,6 +83,7 @@ void RemoteLinuxCheckForFreeDiskSpaceService::deployAndFinish() if (freeSpace < 0) { emit errorMessage(tr("Cannot get info about free disk space for \"%1\"") .arg(path.toUserOutput())); + handleDeploymentDone(); return; } @@ -97,11 +95,13 @@ void RemoteLinuxCheckForFreeDiskSpaceService::deployAndFinish() emit errorMessage(tr("The remote file system has only %n megabytes of free space, " "but %1 megabytes are required.", nullptr, freeSpaceMB) .arg(requiredSpaceMB)); + handleDeploymentDone(); return; } emit progressMessage(tr("The remote file system has %n megabytes of free space, going ahead.", nullptr, freeSpaceMB)); + handleDeploymentDone(); } CheckResult RemoteLinuxCheckForFreeDiskSpaceService::isDeploymentPossible() const