20 #include <tqcstring.h>
21 #include <kdatastream.h>
23 #include <kapplication.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 ==
"kdesu_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(__KDE_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:" __KDE_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 ); }