forked from qt-creator/qt-creator
AbstractRemoteLinuxDeployService: Simplify internal data
Replace stopRequested field with Stopping state. Change-Id: I75d098e5913b59fd7ace2881c6e0c42e70c06667 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -23,7 +23,7 @@ namespace RemoteLinux {
|
||||
namespace Internal {
|
||||
|
||||
namespace {
|
||||
enum State { Inactive, Deploying };
|
||||
enum State { Inactive, Deploying, Stopping };
|
||||
} // anonymous namespace
|
||||
|
||||
class AbstractRemoteLinuxDeployServicePrivate
|
||||
@@ -34,7 +34,6 @@ public:
|
||||
|
||||
DeploymentTimeInfo deployTimes;
|
||||
State state = Inactive;
|
||||
bool stopRequested = false;
|
||||
};
|
||||
} // namespace Internal
|
||||
|
||||
@@ -117,13 +116,10 @@ void AbstractRemoteLinuxDeployService::start()
|
||||
|
||||
void AbstractRemoteLinuxDeployService::stop()
|
||||
{
|
||||
if (d->stopRequested)
|
||||
if (d->state != Deploying)
|
||||
return;
|
||||
|
||||
if (d->state == Deploying) {
|
||||
d->stopRequested = true;
|
||||
stopDeployment();
|
||||
}
|
||||
d->state = Stopping;
|
||||
stopDeployment();
|
||||
}
|
||||
|
||||
CheckResult AbstractRemoteLinuxDeployService::isDeploymentPossible() const
|
||||
@@ -145,9 +141,8 @@ void AbstractRemoteLinuxDeployService::importDeployTimes(const QVariantMap &map)
|
||||
|
||||
void AbstractRemoteLinuxDeployService::handleDeploymentDone()
|
||||
{
|
||||
QTC_ASSERT(d->state == Deploying, return);
|
||||
QTC_ASSERT(d->state != Inactive, return);
|
||||
d->state = Inactive;
|
||||
d->stopRequested = false;
|
||||
emit finished();
|
||||
}
|
||||
|
||||
|
@@ -69,7 +69,6 @@ protected:
|
||||
|
||||
void saveDeploymentTimeStamp(const ProjectExplorer::DeployableFile &deployableFile,
|
||||
const QDateTime &remoteTimestamp);
|
||||
|
||||
bool hasLocalFileChanged(const ProjectExplorer::DeployableFile &deployableFile) const;
|
||||
bool hasRemoteFileChanged(const ProjectExplorer::DeployableFile &deployableFile,
|
||||
const QDateTime &remoteTimestamp) const;
|
||||
@@ -81,7 +80,6 @@ private:
|
||||
virtual void doDeploy() = 0;
|
||||
virtual void stopDeployment() = 0;
|
||||
|
||||
|
||||
Internal::AbstractRemoteLinuxDeployServicePrivate * const d;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user