NepomukDaemons
ProcessControl Class Reference
This class starts and observes a process. More...
#include <processcontrol.h>

Public Types | |
| enum | CrashPolicy { StopOnCrash, RestartOnCrash } |
Signals | |
| void | finished (bool clean) |
| void | processErrorMessages (const QString &errorMsg) |
Public Member Functions | |
| ProcessControl (QObject *parent=0) | |
| ~ProcessControl () | |
| bool | isRunning () const |
| void | setCrashPolicy (CrashPolicy policy) |
| bool | start (const QString &application, const QStringList &arguments=QStringList(), CrashPolicy policy=RestartOnCrash, int maxCrashes=5) |
| void | stop () |
Detailed Description
This class starts and observes a process.
Depending on the policy it also restarts the process when it crashes.
Definition at line 32 of file processcontrol.h.
Member Enumeration Documentation
Theses enums describe the behaviour when the observed application crashed.
- StopOnCrash - The application won't be restarted.
- RestartOnCrash - The application is restarted with the same arguments.
Definition at line 44 of file processcontrol.h.
Constructor & Destructor Documentation
| ProcessControl::ProcessControl | ( | QObject * | parent = 0 |
) |
Creates a new process control.
- Parameters:
-
parent The parent object.
Definition at line 27 of file processcontrol.cpp.
| ProcessControl::~ProcessControl | ( | ) |
Destroys the process control.
Definition at line 40 of file processcontrol.cpp.
Member Function Documentation
| void ProcessControl::finished | ( | bool | clean | ) | [signal] |
| bool ProcessControl::isRunning | ( | ) | const |
Definition at line 143 of file processcontrol.cpp.
| void ProcessControl::processErrorMessages | ( | const QString & | errorMsg | ) | [signal] |
This signal is emitted whenever the observed application writes something to stderr.
- Parameters:
-
errorMsg The error output of the observed application.
| void ProcessControl::setCrashPolicy | ( | CrashPolicy | policy | ) |
Sets the crash policy.
Definition at line 57 of file processcontrol.cpp.
| bool ProcessControl::start | ( | const QString & | application, | |
| const QStringList & | arguments = QStringList(), |
|||
| CrashPolicy | policy = RestartOnCrash, |
|||
| int | maxCrashes = 5 | |||
| ) |
Starts the application with the given list of arguments.
Definition at line 45 of file processcontrol.cpp.
| void ProcessControl::stop | ( | ) |
Stops the currently running application.
Definition at line 62 of file processcontrol.cpp.
The documentation for this class was generated from the following files:
KDE 4.5 API Reference