MCPcopy Create free account
hub / github.com/KDE/kdevelop / doKill

Method doKill

kdevplatform/outputview/outputexecutejob.cpp:290–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290bool OutputExecuteJob::doKill()
291{
292 Q_D(OutputExecuteJob);
293
294 const int terminateKillTimeout = 1000; // msecs
295
296 if( d->m_status != JobRunning ) {
297 return true;
298 }
299 d->m_status = JobCanceled;
300
301 d->m_process->terminate();
302 bool terminated = d->m_process->waitForFinished( terminateKillTimeout );
303 if( !terminated ) {
304 d->m_process->kill();
305 terminated = d->m_process->waitForFinished( terminateKillTimeout );
306 }
307 d->m_lineMaker->flushBuffers();
308 if( terminated ) {
309 model()->appendLine( i18n( "*** Killed process ***" ) );
310 } else {
311 // It survived SIGKILL, leave it alone...
312 qCWarning(OUTPUTVIEW) << "Could not kill the running process:" << d->m_process->error();
313 model()->appendLine( i18n( "*** Warning: could not kill the process ***" ) );
314 return false;
315 }
316 return true;
317}
318
319void OutputExecuteJob::childProcessError( QProcess::ProcessError processError )
320{

Callers

nothing calls this directly

Calls 5

modelFunction · 0.85
flushBuffersMethod · 0.80
killMethod · 0.45
appendLineMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected