You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
681 B
43 lines
681 B
15 years ago
|
//
|
||
|
// DUMMY -- A dummy class with a slot to demonstrate KProcess signals
|
||
|
//
|
||
|
// version 0.2, Aug 2nd 1997
|
||
|
//
|
||
|
// (C) Christian Czezatke
|
||
|
// e9025461@student.tuwien.ac.at
|
||
|
//
|
||
|
|
||
|
|
||
|
#ifndef __DUMMY_H__
|
||
|
#define __DUMMY_H__
|
||
|
|
||
|
#include <stdio.h>
|
||
15 years ago
|
#include <tqobject.h>
|
||
15 years ago
|
#include "kprocio.h"
|
||
|
|
||
14 years ago
|
class Dummy : public TQObject
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public slots:
|
||
|
void printMessage(KProcess *proc)
|
||
|
{
|
||
|
printf("Process %d exited!\n", (int)proc->getPid());
|
||
|
}
|
||
|
|
||
|
void gotOutput(KProcIO*proc)
|
||
|
{
|
||
15 years ago
|
TQString line;
|
||
15 years ago
|
while(true) {
|
||
|
int result = proc->readln(line);
|
||
|
if (result == -1) return;
|
||
|
printf("OUTPUT>> [%d] '%s'\n", result, line.latin1());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|