process.cpp
author insilmaril
Mon Feb 12 09:28:46 2007 +0000 (2007-02-12)
changeset 425 7014be3ac7d0
parent 408 c2a05fa925a1
child 429 69a4c16bd85b
permissions -rw-r--r--
1.8.66 Various fixes
     1 #include "process.h"
     2 
     3 /////////////////////////////////////////////////////////////////
     4 // Process
     5 /////////////////////////////////////////////////////////////////
     6 Process::Process()
     7 {
     8 	connect( this, SIGNAL(readyReadStandardError()),
     9 			 this, SLOT(readProcErrout()) );
    10 	connect( this, SIGNAL(readyReadStandardOutput()),
    11 			 this, SLOT(readProcStdout()) );
    12 	clear();		 
    13 }
    14 
    15 Process::~Process()
    16 {
    17 }
    18 
    19 void Process::clear()
    20 {
    21 	errOut="";
    22 	stdOut="";
    23 }
    24 
    25 void Process::waitFinished()
    26 {
    27 	while (state()==QProcess::Running)
    28 	{
    29 		// TODO use some kind of sleep here...
    30 		system ("sleep 1");
    31 	}
    32 }
    33 
    34 void Process::readProcErrout()
    35 {
    36 	errOut+=readAllStandardError();
    37 }
    38 
    39 void Process::readProcStdout()
    40 {
    41 	stdOut+=readAllStandardOutput();
    42 }
    43 
    44 QString Process::getErrout()
    45 {
    46 	return errOut;
    47 }
    48 
    49 QString Process::getStdout()
    50 {
    51 	return stdOut;
    52 }