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