20 #include <tqcstring.h>
21 #include <kdatastream.h>
23 #include <tdeapplication.h>
25 #include <dcopclient.h>
31 StubProcess::StubProcess()
34 m_Scheduler = SchedNormal;
38 m_bDCOPForwarding =
false;
42 StubProcess::~StubProcess()
59 TQCString StubProcess::commaSeparatedList(QCStringList lst)
64 QCStringList::Iterator it = lst.begin();
66 for (it++; it!=lst.end(); it++)
89 if (line ==
"tdesu_stub")
95 }
else if (line ==
"display") {
97 }
else if (line ==
"display_auth") {
103 }
else if (line ==
"dcopserver") {
104 if (m_bDCOPForwarding)
108 }
else if (line ==
"dcop_auth") {
109 if (m_bDCOPForwarding)
113 }
else if (line ==
"ice_auth") {
114 if (m_bDCOPForwarding)
118 }
else if (line ==
"command") {
120 }
else if (line ==
"path") {
121 TQCString path = getenv(
"PATH");
122 if (!path.isEmpty() && path[0] ==
':')
124 if (m_User ==
"root")
126 path =
"/usr/local/sbin:/usr/sbin:/sbin:" + path;
128 if (strcmp(__TDE_BINDIR,
"/usr/bin") == 0) {
129 path =
"/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin";
132 path =
"/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:" __TDE_BINDIR
":/usr/bin:/bin";
135 }
else if (line ==
"user") {
137 }
else if (line ==
"priority") {
138 tmp.setNum(m_Priority);
140 }
else if (line ==
"scheduler") {
141 if (m_Scheduler == SchedRealtime)
writeLine(
"realtime");
143 }
else if (line ==
"xwindows_only") {
146 }
else if (line ==
"app_startup_id") {
147 QCStringList env = environment();
149 for( QCStringList::ConstIterator it = env.begin();
153 if( (*it).find(
"DESKTOP_STARTUP_ID=" ) == 0 )
154 tmp = (*it).mid( strlen(
"DESKTOP_STARTUP_ID=" ));
159 }
else if (line ==
"app_start_pid") {
160 tmp.setNum(getpid());
162 }
else if (line ==
"environment") {
163 QCStringList env = environment();
164 for( QCStringList::ConstIterator it = env.begin();
169 }
else if (line ==
"end") {
173 kdWarning(900) << k_lineinfo <<
"Unknown request: -->" << line
185 kdWarning(900) <<
"Obsolete StubProcess::notifyTaskbar() called!" << endl;
188 void StubProcess::virtual_hook(
int id,
void* data )
189 { PtyProcess::virtual_hook(
id, data ); }
Utility class to access the authentication tokens needed to run a KDE program (X11 and DCOP cookies).
void writeLine(const TQCString &line, bool addNewline=true)
Writes a line of text to the program's standard in.
TQCString readLine(bool block=true)
Reads a line from the program's standard out.
int enableLocalEcho(bool enable=true)
Enables/disables local echo on the pseudo tty.
virtual TQCString display()
This virtual function can be overloaded when special behavior is desired.
void setPriority(int prio)
Set the priority of the process.
void notifyTaskbar(const TQString &suffix)
Notify the taskbar that a new application has been started.
virtual TQCString dcopAuth()
See display.
int ConverseStub(int check)
Exchange all parameters with tdesu_stub.
virtual TQCString dcopServer()
See display.
virtual TQCString iceAuth()
See display.