QtcProcess: Add starting() signal

Will be useful for VcsCommand controlling.

Change-Id: I6e0199c7a45948526cfd916907b098472b78219c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-10-06 15:33:15 +02:00
parent 363731a8c8
commit db5e3555ac
2 changed files with 11 additions and 2 deletions

View File

@@ -704,6 +704,7 @@ public:
void handleDone(const ProcessResultData &data); void handleDone(const ProcessResultData &data);
void clearForRun(); void clearForRun();
void emitStarting();
void emitStarted(); void emitStarted();
void emitDone(); void emitDone();
void emitReadyReadStandardOutput(); void emitReadyReadStandardOutput();
@@ -1149,6 +1150,7 @@ void QtcProcess::start()
// Pass a dynamic property with info about blocking type // Pass a dynamic property with info about blocking type
d->m_process->setProperty(QTC_PROCESS_BLOCKING_TYPE, property(QTC_PROCESS_BLOCKING_TYPE)); d->m_process->setProperty(QTC_PROCESS_BLOCKING_TYPE, property(QTC_PROCESS_BLOCKING_TYPE));
} }
d->emitStarting();
d->m_process->start(); d->m_process->start();
} }
@@ -2031,6 +2033,12 @@ void QtcProcessPrivate::handleDone(const ProcessResultData &data)
m_applicationMainThreadId = 0; m_applicationMainThreadId = 0;
} }
void QtcProcessPrivate::emitStarting()
{
GuardLocker locker(m_guard);
emit q->starting();
}
void QtcProcessPrivate::emitStarted() void QtcProcessPrivate::emitStarted()
{ {
GuardLocker locker(m_guard); GuardLocker locker(m_guard);

View File

@@ -177,8 +177,9 @@ public:
QString toStandaloneCommandLine() const; QString toStandaloneCommandLine() const;
signals: signals:
void started(); void starting(); // On NotRunning -> Starting state transition
void done(); void started(); // On Starting -> Running state transition
void done(); // On Starting | Running -> NotRunning state transition
void readyReadStandardOutput(); void readyReadStandardOutput();
void readyReadStandardError(); void readyReadStandardError();