KDE3Support
k3process.cpp
Go to the documentation of this file.
807 kWarning(175) << "Invalid usePty/communication combination (" << d->usePty << "/" << comm << ")" << endl;
static void deref()
Destroy the instance if one exists and it is not referenced any more.
Definition k3processcontroller.cpp:73
static K3ProcessController * instance()
Only a single instance of this class is allowed at a time.
Definition k3processcontroller.cpp:83
void rescheduleCheck()
This function must be called at some point after calling unscheduleCheck().
Definition k3processcontroller.cpp:233
void unscheduleCheck()
Call this function to defer processing of the data that became available on notifierFd().
Definition k3processcontroller.cpp:225
void removeKProcess(K3Process *)
Definition k3processcontroller.cpp:321
static QString quote(const QString &arg)
This function can be used to quote an argument string such that the shell processes it properly.
Definition k3process.cpp:735
void wroteStdin(K3Process *proc)
Emitted after all the data that has been specified by a prior call to writeStdin() has actually been ...
void setRunPrivileged(bool keepPrivileges)
Controls whether the started process should drop any setuid/setgid privileges or whether it should ke...
Definition k3process.cpp:156
void slotChildError(int fdno)
This slot gets activated when data from the child's stderr arrives.
Definition k3process.cpp:666
virtual int commSetupDoneC()
Called right after a (successful) fork(), but before an exec() on the child process' side.
Definition k3process.cpp:911
K3Process & operator<<(const QString &arg)
Sets the executable and the command line argument list for this process.
Definition k3process.cpp:228
bool keepPrivs
If false, the child process' effective uid & gid will be reset to the real values.
Definition k3process.h:690
virtual void processHasExited(int state)
Immediately called after a successfully started process in NotifyOnExit mode has exited.
Definition k3process.cpp:747
void suspend()
Suspend processing of data from stdout of the child process.
Definition k3process.cpp:580
void setUsePty(Communication comm, bool addUtmp)
Specify whether to create a pty (pseudo-terminal) for running the command.
Definition k3process.cpp:717
int childError(int fdno)
Called by slotChildError() this function copies data arriving from the child process' stderr to the r...
Definition k3process.cpp:785
QList< QByteArray > arguments
The list of the process' command line arguments.
Definition k3process.h:652
void receivedStdout(K3Process *proc, char *buffer, int buflen)
Emitted, when output from the child process has been received on stdout.
virtual void commClose()
Cleans up the communication links to the child after it has exited.
Definition k3process.cpp:959
@ DontCare
The application does not receive notifications from the subprocess when it is finished or aborted.
Definition k3process.h:170
@ OwnGroup
Same as NotifyOnExit, but the process is run in an own session, just like with DontCare.
Definition k3process.h:183
@ Block
The application is suspended until the started process is finished.
Definition k3process.h:178
void setEnvironment(const QString &name, const QString &value)
Adds the variable name to the process' environment.
Definition k3process.cpp:129
void processExited(K3Process *proc)
Emitted after the process has terminated when the process was run in the NotifyOnExit (==default opti...
@ MergedStderr
If specified with Stdout, the process' stderr will be redirected onto the same file handle as its std...
Definition k3process.h:154
@ NoRead
If specified with Stdout, no data is actually read from stdout, only the signal receivedStdout(int fd...
Definition k3process.h:149
int childOutput(int fdno)
Called by slotChildOutput() this function copies data arriving from the child process' stdout to the ...
Definition k3process.cpp:762
Communication communication
Lists the communication links that are activated for the child process.
Definition k3process.h:808
void setUseShell(bool useShell, const char *shell=0)
Specify whether to start the command via a shell or directly.
Definition k3process.cpp:693
bool wait(int timeout=-1)
Suspend execution of the current thread until the child process dies or the timeout hits.
Definition k3process.cpp:462
bool signalled() const
Checks whether the process was killed by a signal.
Definition k3process.cpp:532
bool runPrivileged() const
Returns whether the started process will drop any setuid/setgid privileges or whether it will keep th...
Definition k3process.cpp:162
void setupEnvironment()
Sets up the environment according to the data passed via setEnvironment()
Definition k3process.cpp:141
const char * input_data
The buffer holding the data that has to be sent to the child.
Definition k3process.h:827
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition k3process.cpp:239
const QList< QByteArray > & args()
Lets you see what your arguments are for debugging.
Definition k3process.h:435
void setBinaryExecutable(const char *filename)
Specify the actual executable that should be started (first argument to execve) Normally the first ar...
Definition k3process.cpp:204
void receivedStderr(K3Process *proc, char *buffer, int buflen)
Emitted, when output from the child process has been received on stderr.
void slotSendData(int dummy)
Called when another bulk of data can be sent to the child's stdin.
Definition k3process.cpp:673
void slotChildOutput(int fdno)
This slot gets activated when data from the child's stdout arrives.
Definition k3process.cpp:659
virtual int commSetupDoneP()
Called right after a (successful) fork() on the parent side.
Definition k3process.cpp:866
void setWorkingDirectory(const QString &dir)
Changes the current working directory (CWD) of the process to be started.
Definition k3process.cpp:135
virtual bool kill(int signo=SIGTERM)
Stop the process (by sending it a signal).
Definition k3process.cpp:429
void resume()
Resume processing of data from stdout of the child process.
Definition k3process.cpp:586
void clearArguments()
Clear a command line argument list that has been set by using operator<<.
Definition k3process.cpp:234
virtual int setupCommunication(Communication comm)
This function is called from start() right before a fork() takes place.
Definition k3process.cpp:800
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition k3process.cpp:1046
UseRealUserID
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
int timeout
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.