summaryrefslogtreecommitdiff
path: root/libopie/oprocess.cpp
Unidiff
Diffstat (limited to 'libopie/oprocess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/oprocess.cpp94
1 files changed, 49 insertions, 45 deletions
diff --git a/libopie/oprocess.cpp b/libopie/oprocess.cpp
index f3e52bd..5db2b6c 100644
--- a/libopie/oprocess.cpp
+++ b/libopie/oprocess.cpp
@@ -96,18 +96,38 @@ public:
96 96
97OProcess::OProcess() 97OProcess::OProcess(QObject *parent, const char *name)
98 : QObject(), 98 : QObject(parent, name)
99 run_mode(NotifyOnExit),
100 runs(false),
101 pid_(0),
102 status(0),
103 keepPrivs(false),
104 innot(0),
105 outnot(0),
106 errnot(0),
107 communication(NoCommunication),
108 input_data(0),
109 input_sent(0),
110 input_total(0),
111 d(0)
112{ 99{
100 init ( );
101}
102
103OProcess::OProcess(const QString &arg0, QObject *parent, const char *name)
104 : QObject(parent, name)
105{
106 init ( );
107 *this << arg0;
108}
109
110OProcess::OProcess(const QStringList &args, QObject *parent, const char *name)
111 : QObject(parent, name)
112{
113 init ( );
114 *this << args;
115}
116
117void OProcess::init ( )
118{
119 run_mode = NotifyOnExit;
120 runs = false;
121 pid_ = 0;
122 status = 0;
123 keepPrivs = false;
124 innot = 0;
125 outnot = 0;
126 errnot = 0;
127 communication = NoCommunication;
128 input_data = 0;
129 input_sent = 0;
130 input_total = 0;
131 d = 0;
132
113 if (0 == OProcessController::theOProcessController) { 133 if (0 == OProcessController::theOProcessController) {
@@ -474,2 +494,16 @@ bool OProcess::writeStdin(const char *buffer, int buflen)
474 494
495void OProcess::flushStdin ( )
496{
497 if ( !input_data || ( input_sent == input_total ))
498 return;
499
500 int d1, d2;
501
502 do {
503 d1 = input_total - input_sent;
504 slotSendData ( 0 );
505 d2 = input_total - input_sent;
506 } while ( d2 <= d1 );
507}
508
475void OProcess::suspend() 509void OProcess::suspend()
@@ -890,33 +924,3 @@ bool OProcess::isExecutable(const QCString &filename)
890 924
891void OProcess::virtual_hook( int, void* )
892{ /*BASE::virtual_hook( id, data );*/ }
893
894
895///////////////////////////
896// CC: Class KShellProcess
897///////////////////////////
898
899KShellProcess::KShellProcess(const char *shellname):
900 OProcess()
901{
902 setUseShell(true, shellname);
903}
904
905
906KShellProcess::~KShellProcess() {
907}
908
909QString KShellProcess::quote(const QString &arg)
910{
911 return OProcess::quote(arg);
912}
913
914bool KShellProcess::start(RunMode runmode, Communication comm)
915{
916 return OProcess::start(runmode, comm);
917}
918 925
919void KShellProcess::virtual_hook( int id, void* data )
920{ OProcess::virtual_hook( id, data ); }
921 926
922//#include "kprocess.moc"