process.cpp
branchrelease-1-12-maintained
changeset 54 e47fe0d7b05b
child 81 876eed30ba3b
child 216 d5a0ea67c91d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/process.cpp	Mon Dec 01 16:44:35 2008 +0000
     1.3 @@ -0,0 +1,51 @@
     1.4 +#include "process.h"
     1.5 +
     1.6 +/////////////////////////////////////////////////////////////////
     1.7 +// Process
     1.8 +/////////////////////////////////////////////////////////////////
     1.9 +Process::Process()
    1.10 +{
    1.11 +	connect( this, SIGNAL(readyReadStderr()),
    1.12 +			 this, SLOT(readProcErrout()) );
    1.13 +	connect( this, SIGNAL(readyReadStdout()),
    1.14 +			 this, SLOT(readProcStdout()) );
    1.15 +	clear();		 
    1.16 +}
    1.17 +
    1.18 +Process::~Process()
    1.19 +{
    1.20 +}
    1.21 +
    1.22 +void Process::clear()
    1.23 +{
    1.24 +	errOut="";
    1.25 +	stdOut="";
    1.26 +}
    1.27 +
    1.28 +void Process::waitFinished()
    1.29 +{
    1.30 +	while (isRunning())
    1.31 +	{
    1.32 +	// FIXME use some kind of sleep here...
    1.33 +	}
    1.34 +}
    1.35 +
    1.36 +void Process::readProcErrout()
    1.37 +{
    1.38 +	errOut+=readStderr();
    1.39 +}
    1.40 +
    1.41 +void Process::readProcStdout()
    1.42 +{
    1.43 +	stdOut+=readStdout();
    1.44 +}
    1.45 +
    1.46 +QString Process::getErrout()
    1.47 +{
    1.48 +	return errOut;
    1.49 +}
    1.50 +
    1.51 +QString Process::getStdout()
    1.52 +{
    1.53 +	return stdOut;
    1.54 +}