forked from qt-creator/qt-creator
Process: Get rid of setTimeoutS()
Add an extra arg to runBlocking() function instead. Use std::chrono::seconds for timeout. Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -297,6 +297,7 @@ CommandResult VcsCommand::runBlocking(const FilePath &workingDirectory,
|
||||
return vcsCommand.runBlockingHelper(command, timeoutS);
|
||||
}
|
||||
|
||||
// TODO: change timeout to std::chrono::seconds
|
||||
CommandResult VcsCommand::runBlockingHelper(const CommandLine &command, int timeoutS)
|
||||
{
|
||||
Process process;
|
||||
@@ -305,11 +306,10 @@ CommandResult VcsCommand::runBlockingHelper(const CommandLine &command, int time
|
||||
|
||||
const Internal::VcsCommandPrivate::Job job{command, timeoutS, d->m_defaultWorkingDirectory};
|
||||
d->setupProcess(&process, job);
|
||||
process.setTimeoutS(timeoutS);
|
||||
|
||||
const EventLoopMode eventLoopMode = d->eventLoopMode();
|
||||
process.setTimeOutMessageBoxEnabled(eventLoopMode == EventLoopMode::On);
|
||||
process.runBlocking(eventLoopMode);
|
||||
process.runBlocking(std::chrono::seconds(timeoutS), eventLoopMode);
|
||||
d->handleDone(&process, job);
|
||||
|
||||
return CommandResult(process);
|
||||
|
||||
Reference in New Issue
Block a user