Commit c839e868 authored by hjk's avatar hjk

ProjectExplorer: Introduce RunWorker::reportDone()

To be used for short-lived tasks to signal that they are done.
Essentially an optional reportStarted() followed by reportStopped()

Using it in GdbServerPortsGatherer when the port list is ready fixes
the wrong "un-stopped" situation in RemoteLinux debugging when
the inferior finishes by itself.

Change-Id: I310831a7875fe6f2c598302b73cda6c9669efb1d
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent b7507f3a
......@@ -685,7 +685,7 @@ void GdbServerPortsGatherer::handlePortListReady()
return;
}
}
reportStarted();
reportDone();
}
// GdbServerRunner
......
......@@ -1586,6 +1586,33 @@ void RunWorker::reportStopped()
emit stopped();
}
/*!
* This function can be called by a RunWorker implementation for short-lived
* tasks to notify its RunControl about this task being successful finished.
* Dependent startup tasks can proceed, in cases of spontaneous or scheduled
* stops, the effect is the same as \c reportStopped().
*
*/
void RunWorker::reportDone()
{
switch (d->state) {
case RunWorkerState::Initialized:
QTC_CHECK(false);
d->state = RunWorkerState::Done;
break;
case RunWorkerState::Starting:
reportStarted();
reportStopped();
break;
case RunWorkerState::Running:
case RunWorkerState::Stopping:
reportStopped();
break;
case RunWorkerState::Done:
break;
}
}
/*!
* This function can be called by a RunWorker implementation to
* signal a problem in the operation in this worker. The
......
......@@ -347,6 +347,8 @@ public:
void initiateStop();
void reportStopped();
void reportDone();
void reportFailure(const QString &msg = QString());
void setSupportsReRunning(bool reRunningSupported);
bool supportsReRunning() const;
......
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