summaryrefslogtreecommitdiffstats
path: root/tdecore/tests/kprociotest.h
blob: 9f948e644db2a24e9213ea34873c12907b184632 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
//  DUMMY -- A dummy class with a slot to demonstrate KProcess signals
//
//  version 0.2, Aug 2nd 1997
//
//  (C) Christian Czezatke
//  [email protected]
//


#ifndef __DUMMY_H__
#define __DUMMY_H__

#include <stdio.h>
#include <tqobject.h>
#include "kprocio.h"

class Dummy : public TQObject
{
 Q_OBJECT

 public slots:
   void printMessage(KProcess *proc)
   {
     printf("Process %d exited!\n", (int)proc->getPid()); 
   } 
 
   void gotOutput(KProcIO*proc)
   {
    TQString line;
    while(true) {
       int result = proc->readln(line);
       if (result == -1) return;
       printf("OUTPUT>> [%d] '%s'\n", result, line.latin1());
    }
   }

};

#endif