process.cpp
author jhilmer
Mon Aug 01 19:33:16 2005 +0000 (2005-08-01)
changeset 144 f4bbdc809fec
child 81 876eed30ba3b
child 216 d5a0ea67c91d
permissions -rw-r--r--
Fix: closing of editor when text are modified
insilmaril@0
     1
#include "process.h"
insilmaril@0
     2
insilmaril@0
     3
/////////////////////////////////////////////////////////////////
insilmaril@0
     4
// Process
insilmaril@0
     5
/////////////////////////////////////////////////////////////////
insilmaril@0
     6
Process::Process()
insilmaril@0
     7
{
insilmaril@0
     8
	connect( this, SIGNAL(readyReadStderr()),
insilmaril@0
     9
			 this, SLOT(readProcErrout()) );
insilmaril@0
    10
	connect( this, SIGNAL(readyReadStdout()),
insilmaril@0
    11
			 this, SLOT(readProcStdout()) );
insilmaril@0
    12
	clear();		 
insilmaril@0
    13
}
insilmaril@0
    14
insilmaril@0
    15
Process::~Process()
insilmaril@0
    16
{
insilmaril@0
    17
}
insilmaril@0
    18
insilmaril@0
    19
void Process::clear()
insilmaril@0
    20
{
insilmaril@0
    21
	errOut="";
insilmaril@0
    22
	stdOut="";
insilmaril@0
    23
}
insilmaril@0
    24
insilmaril@0
    25
void Process::waitFinished()
insilmaril@0
    26
{
insilmaril@0
    27
	while (isRunning())
insilmaril@0
    28
	{
insilmaril@0
    29
	// FIXME use some kind of sleep here...
insilmaril@0
    30
	}
insilmaril@0
    31
}
insilmaril@0
    32
insilmaril@0
    33
void Process::readProcErrout()
insilmaril@0
    34
{
insilmaril@0
    35
	errOut+=readStderr();
insilmaril@0
    36
}
insilmaril@0
    37
insilmaril@0
    38
void Process::readProcStdout()
insilmaril@0
    39
{
insilmaril@0
    40
	stdOut+=readStdout();
insilmaril@0
    41
}
insilmaril@0
    42
insilmaril@0
    43
QString Process::getErrout()
insilmaril@0
    44
{
insilmaril@0
    45
	return errOut;
insilmaril@0
    46
}
insilmaril@0
    47
insilmaril@0
    48
QString Process::getStdout()
insilmaril@0
    49
{
insilmaril@0
    50
	return stdOut;
insilmaril@0
    51
}