forked from qt-creator/qt-creator
QtcProcess: Introduce done() signal
Introduce QtcProcess::done() signal. It's similar to QtcProcess::finished() signal, but also emitted when process failed to start (so after QProcess::FailedToStart error occurred). SshRemoteProcess::finished() signal was already behaving like this. So, we remove special handling of FailedToStart error in this class and connect all clients of SshRemoteProcess to done() signal, instead of finished(). Task-number: QTCREATORBUG-27232 Change-Id: If4240e2172f3f706e812bca669a1d5b24bdc3285 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -590,6 +590,8 @@ public:
|
||||
void handleError(QProcess::ProcessError error);
|
||||
void clearForRun();
|
||||
|
||||
void emitErrorOccurred(QProcess::ProcessError error);
|
||||
|
||||
ProcessResult interpretExitCode(int exitCode);
|
||||
|
||||
QTextCodec *m_codec = QTextCodec::codecForLocale();
|
||||
@@ -701,11 +703,7 @@ void QtcProcess::emitStarted()
|
||||
void QtcProcess::emitFinished()
|
||||
{
|
||||
emit finished();
|
||||
}
|
||||
|
||||
void QtcProcess::emitErrorOccurred(QProcess::ProcessError error)
|
||||
{
|
||||
emit errorOccurred(error);
|
||||
emit done();
|
||||
}
|
||||
|
||||
void QtcProcess::setProcessInterface(ProcessInterface *interface)
|
||||
@@ -1647,7 +1645,14 @@ void QtcProcessPrivate::handleError(QProcess::ProcessError error)
|
||||
if (m_eventLoop)
|
||||
m_eventLoop->quit();
|
||||
|
||||
q->emitErrorOccurred(error);
|
||||
emitErrorOccurred(error);
|
||||
}
|
||||
|
||||
void QtcProcessPrivate::emitErrorOccurred(QProcess::ProcessError error)
|
||||
{
|
||||
emit q->errorOccurred(error);
|
||||
if (error == QProcess::FailedToStart)
|
||||
emit q->done();
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Reference in New Issue
Block a user