KDEsu
Go to the documentation of this file.
20 #include <QtCore/QBool>
28 using namespace KDESuPrivate;
85 for (
int i = 0; i < lst.count(); ++i) {
92 void StubProcess::writeString(
const QByteArray &str)
95 out.reserve(str.size() + 8);
96 for (
int i = 0; i < str.size(); i++) {
101 }
else if (c ==
'\\') {
115 template<
int T>
struct PIDType {
typedef pid_t PID_t; } ;
116 template<>
struct PIDType<2> {
typedef qint16 PID_t; } ;
117 template<>
struct PIDType<4> {
typedef qint32 PID_t; } ;
127 QByteArray line, tmp;
135 if (line ==
"kdesu_stub")
151 if (line ==
"display") {
153 }
else if (line ==
"display_auth") {
159 }
else if (line ==
"command") {
161 }
else if (line ==
"path") {
162 QByteArray path = qgetenv(
"PATH");
163 if (!path.isEmpty() && path[0] ==
':')
167 path =
"/sbin:/bin:/usr/sbin:/usr/bin:" + path;
169 path =
"/sbin:/bin:/usr/sbin:/usr/bin";
172 }
else if (line ==
"user") {
174 }
else if (line ==
"priority") {
177 }
else if (line ==
"scheduler") {
180 }
else if (line ==
"xwindows_only") {
183 }
else if (line ==
"app_startup_id") {
186 for(
int i = 0; i < env.count(); ++i)
188 const char startup_env[] =
"DESKTOP_STARTUP_ID=";
189 if (env.at(i).startsWith(startup_env))
190 tmp = env.at(i).mid(
sizeof(startup_env) - 1);
195 }
else if (line ==
"app_start_pid") {
199 tmp.setNum((PIDType<
sizeof(pid_t)>::PID_t)(getpid()));
201 }
else if (line ==
"environment") {
203 for (
int i = 0; i < env.count(); ++i)
204 writeString(env.at(i));
206 }
else if (line ==
"end") {
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon May 5 2014 18:12:17 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.