Nepomuk-Core
#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) |
void | start (const QString &application, const QStringList &arguments=QStringList(), CrashPolicy policy=RestartOnCrash, int maxCrashes=5) |
void | terminate (bool waitAndKill=false) |
bool | waitForStarted () |
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.
Enumerator | |
---|---|
StopOnCrash | |
RestartOnCrash |
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 29 of file processcontrol.cpp.
ProcessControl::~ProcessControl | ( | ) |
Destroys the process control.
Definition at line 39 of file processcontrol.cpp.
Member Function Documentation
|
signal |
bool ProcessControl::isRunning | ( | ) | const |
Definition at line 116 of file processcontrol.cpp.
|
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.
void 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::terminate | ( | bool | waitAndKill = false | ) |
Sends the term signal to the process.
- Parameters
-
waitAndKill If true
does wait for the process to finish and if it does not kills the process after a timeout. Iffalse
a timer is used instead.
Definition at line 126 of file processcontrol.cpp.
bool ProcessControl::waitForStarted | ( | ) |
Definition at line 143 of file processcontrol.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.