tags:

views:

63

answers:

2

I have a KTerminalInterface (from kparts) in my qt/kdelib app, and I run a command within it.

The problem is: how can I know if the program is terminated? I need to know it because at its end I must reset some variable.

Does anyone got a similar problem?!?

+1  A: 

It isn't possible to communicate with the process once launched via TerminalInterface in KDE 4, since KonsolePart (which implements TerminalInterface) no longer has processExited() or receivedData() signals. In KDE 4, KonsolePart is for interactive terminal sessions, not for your app to use.

In KDE 4, use KProcess to spawn an external command from your app, communicate with it, and detect when it terminates. See the QProcess parts of its API.

Bille
A: 

you might be able to use os.waitpid(-1) to wait for child processes (with another thread if you can't have the main one block).

gatoatigrado