forked from qt-creator/qt-creator
Don't start the process when being in running state
Assert that we are in NotRunning state when starting a process. Otherwise we issue a warning and ignore the new call. Change-Id: Ie8c007851aabb4b814c1fd49bc8d01f22eb1a563 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -330,10 +330,14 @@ void CallerHandle::start(const QString &program, const QStringList &arguments, c
|
||||
emit errorOccurred(m_error);
|
||||
return;
|
||||
}
|
||||
auto startWhenRunning = [&program, &oldProgram = m_command] {
|
||||
qWarning() << "Trying to start" << program << "while" << oldProgram
|
||||
<< "is still running for the same QtcProcess instance."
|
||||
<< "The current call will be ignored.";
|
||||
};
|
||||
QTC_ASSERT(m_processState == QProcess::NotRunning, startWhenRunning(); return);
|
||||
m_command = program;
|
||||
m_arguments = arguments;
|
||||
// TODO: check if state is not running
|
||||
// TODO: check if m_canceled is not true
|
||||
m_writeData = writeData;
|
||||
auto processLauncherNotStarted = [&program] {
|
||||
qWarning() << "Trying to start" << program << "while process launcher wasn't started yet.";
|
||||
|
Reference in New Issue
Block a user