| 222 | |
| 223 | |
| 224 | void Process::initialize(size_t bufSize) |
| 225 | // ---------------------------------------------------------------------------- |
| 226 | // Initialize the process and streambuf |
| 227 | // ---------------------------------------------------------------------------- |
| 228 | { |
| 229 | num = snum++; |
| 230 | |
| 231 | // Allocate data to be used by the streambuf |
| 232 | char *ptr = new char[bufSize]; |
| 233 | setp(ptr, ptr + bufSize); |
| 234 | |
| 235 | // Set up the stderr/stdout signal mechanism |
| 236 | connect(this, SIGNAL(readyReadStandardOutput()), |
| 237 | this, SLOT(readStandardOutput())); |
| 238 | connect(this, SIGNAL(readyReadStandardError()), |
| 239 | this, SLOT(readStandardError())); |
| 240 | |
| 241 | // Set up debug traces |
| 242 | IFTRACE(process) |
| 243 | { |
| 244 | connect(this, SIGNAL(finished(int,QProcess::ExitStatus)), |
| 245 | this, SLOT(debugProcessFinished(int,QProcess::ExitStatus))); |
| 246 | connect(this, SIGNAL(error(QProcess::ProcessError)), |
| 247 | this, SLOT(debugProcessError(QProcess::ProcessError))); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | |
| 252 | void Process::setEnvironment() |