int Q3Process::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: readyReadStdout(); break; case 1: readyReadStderr(); break; case 2: processExited(); break; case 3: wroteToStdin(); break; case 4: launchFinished(); break; case 5: tryTerminate(); break; case 6: kill(); break; case 7: writeToStdin((*reinterpret_cast< const QByteArray(*)>(_a[1]))); break; case 8: writeToStdin((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 9: closeStdin(); break; case 10: socketRead((*reinterpret_cast< int(*)>(_a[1]))); break; case 11: socketWrite((*reinterpret_cast< int(*)>(_a[1]))); break; case 12: timeout(); break; case 13: closeStdinLaunch(); break; } _id -= 14; } return _id; }
/* This private slot is used by the launch() functions to close standard input. */ void QProcess::closeStdinLaunch() { disconnect( this, SIGNAL(wroteToStdin()), this, SLOT(closeStdinLaunch()) ); closeStdin(); emit launchFinished(); }
void K3Process::closeAll() { closeStdin(); closeStdout(); closeStderr(); closePty(); }
/*! \overload The data \a buf is written to standard input with writeToStdin() using the QString::local8Bit() representation of the strings. */ bool QProcess::launch( const QString& buf, QStringList *env ) { if ( start( env ) ) { if ( !buf.isEmpty() ) { connect( this, SIGNAL(wroteToStdin()), this, SLOT(closeStdinLaunch()) ); writeToStdin( buf ); } else { closeStdin(); emit launchFinished(); } return TRUE; } else { emit launchFinished(); return FALSE; } }
bool QProcess::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: tryTerminate(); break; case 1: kill(); break; case 2: writeToStdin((const QByteArray&)*((const QByteArray*)static_QUType_ptr.get(_o+1))); break; case 3: writeToStdin((const QString&)static_QUType_QString.get(_o+1)); break; case 4: closeStdin(); break; case 5: socketRead((int)static_QUType_int.get(_o+1)); break; case 6: socketWrite((int)static_QUType_int.get(_o+1)); break; case 7: timeout(); break; case 8: closeStdinLaunch(); break; default: return QObject::qt_invoke( _id, _o ); } return TRUE; }
void K3Process::slotSendData(int) { if (input_sent == input_total) { innot->setEnabled(false); input_data = 0; emit wroteStdin(this); } else { int result = ::write(in[1], input_data+input_sent, input_total-input_sent); if (result >= 0) { input_sent += result; } else if ((errno != EAGAIN) && (errno != EINTR)) { qDebug() << "Error writing to stdin of child process" << endl; closeStdin(); } } }