summaryrefslogtreecommitdiffabout
path: root/microkde
Unidiff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/oprocctrl.cpp285
-rw-r--r--microkde/oprocctrl.h129
-rw-r--r--microkde/oprocess.cpp952
-rw-r--r--microkde/oprocess.h761
-rw-r--r--microkde/words.sort.txt549
5 files changed, 0 insertions, 2676 deletions
diff --git a/microkde/oprocctrl.cpp b/microkde/oprocctrl.cpp
deleted file mode 100644
index 404e0b3..0000000
--- a/microkde/oprocctrl.cpp
+++ b/dev/null
@@ -1,285 +0,0 @@
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19//
20// KPROCESSCONTROLLER -- A helper class for KProcess
21//
22// version 0.3.1, Jan, 8th 1997
23//
24// (C) Christian Czezatke
25// e9025461@student.tuwien.ac.at
26// Ported by Holger Freyther
27//
28
29//#include <config.h>
30
31#include <sys/types.h>
32#include <sys/socket.h>
33
34#include <errno.h>
35#include <fcntl.h>
36#include <stdio.h>
37#include <string.h>
38#include <unistd.h>
39#include <assert.h>
40
41#include <qsocketnotifier.h>
42#include "oprocctrl.h"
43
44using namespace Opie::Core::Internal;
45
46OProcessController *OProcessController::theOProcessController = 0;
47
48struct sigaction OProcessController::oldChildHandlerData;
49bool OProcessController::handlerSet = false;
50
51OProcessController::OProcessController()
52{
53 assert( theOProcessController == 0 );
54
55 if (0 > pipe(fd))
56 printf(strerror(errno));
57
58 notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read);
59 notifier->setEnabled(true);
60 QObject::connect(notifier, SIGNAL(activated(int)),
61 this, SLOT(slotDoHousekeeping(int)));
62 connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()),
63 SLOT( delayedChildrenCleanup()));
64
65 theOProcessController = this;
66
67 setupHandlers();
68}
69
70
71void OProcessController::setupHandlers()
72{
73 if( handlerSet )
74 return;
75 struct sigaction act;
76 act.sa_handler=theSigCHLDHandler;
77 sigemptyset(&(act.sa_mask));
78 sigaddset(&(act.sa_mask), SIGCHLD);
79 // Make sure we don't block this signal. gdb tends to do that :-(
80 sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0);
81
82 act.sa_flags = SA_NOCLDSTOP;
83
84 // CC: take care of SunOS which automatically restarts interrupted system
85 // calls (and thus does not have SA_RESTART)
86
87#ifdef SA_RESTART
88 act.sa_flags |= SA_RESTART;
89#endif
90
91 sigaction( SIGCHLD, &act, &oldChildHandlerData );
92
93 act.sa_handler=SIG_IGN;
94 sigemptyset(&(act.sa_mask));
95 sigaddset(&(act.sa_mask), SIGPIPE);
96 act.sa_flags = 0;
97 sigaction( SIGPIPE, &act, 0L);
98 handlerSet = true;
99}
100
101void OProcessController::resetHandlers()
102{
103 if( !handlerSet )
104 return;
105 sigaction( SIGCHLD, &oldChildHandlerData, 0 );
106 // there should be no problem with SIGPIPE staying SIG_IGN
107 handlerSet = false;
108}
109
110// block SIGCHLD handler, because it accesses processList
111void OProcessController::addOProcess( OProcess* p )
112{
113 sigset_t newset, oldset;
114 sigemptyset( &newset );
115 sigaddset( &newset, SIGCHLD );
116 sigprocmask( SIG_BLOCK, &newset, &oldset );
117 processList.append( p );
118 sigprocmask( SIG_SETMASK, &oldset, 0 );
119}
120
121void OProcessController::removeOProcess( OProcess* p )
122{
123 sigset_t newset, oldset;
124 sigemptyset( &newset );
125 sigaddset( &newset, SIGCHLD );
126 sigprocmask( SIG_BLOCK, &newset, &oldset );
127 processList.remove( p );
128 sigprocmask( SIG_SETMASK, &oldset, 0 );
129}
130
131//using a struct which contains both the pid and the status makes it easier to write
132//and read the data into the pipe
133//especially this solves a problem which appeared on my box where slotDoHouseKeeping() received
134//only 4 bytes (with some debug output around the write()'s it received all 8 bytes)
135//don't know why this happened, but when writing all 8 bytes at once it works here, aleXXX
136struct waitdata
137{
138 pid_t pid;
139 int status;
140};
141
142void OProcessController::theSigCHLDHandler(int arg)
143{
144 struct waitdata wd;
145 // int status;
146 // pid_t this_pid;
147 int saved_errno;
148
149 saved_errno = errno;
150 // since waitpid and write change errno, we have to save it and restore it
151 // (Richard Stevens, Advanced programming in the Unix Environment)
152
153 bool found = false;
154 if( theOProcessController != 0 )
155 {
156 // iterating the list doesn't perform any system call
157 for( QValueList<OProcess*>::ConstIterator it = theOProcessController->processList.begin();
158 it != theOProcessController->processList.end();
159 ++it )
160 {
161 if( !(*it)->isRunning())
162 continue;
163 wd.pid = waitpid( (*it)->pid(), &wd.status, WNOHANG );
164 if ( wd.pid > 0 )
165 {
166 ::write(theOProcessController->fd[1], &wd, sizeof(wd));
167 found = true;
168 }
169 }
170 }
171 if( !found && oldChildHandlerData.sa_handler != SIG_IGN
172 && oldChildHandlerData.sa_handler != SIG_DFL )
173 oldChildHandlerData.sa_handler( arg ); // call the old handler
174 // handle the rest
175 if( theOProcessController != 0 )
176 {
177 static const struct waitdata dwd = { 0, 0 }
178 ; // delayed waitpid()
179 ::write(theOProcessController->fd[1], &dwd, sizeof(dwd));
180 }
181 else
182 {
183 int dummy;
184 while( waitpid( -1, &dummy, WNOHANG ) > 0 )
185 ;
186 }
187
188 errno = saved_errno;
189}
190
191
192
193void OProcessController::slotDoHousekeeping(int )
194{
195 unsigned int bytes_read = 0;
196 unsigned int errcnt=0;
197 // read pid and status from the pipe.
198 struct waitdata wd;
199 while ((bytes_read < sizeof(wd)) && (errcnt < 50))
200 {
201 int r = ::read(fd[0], ((char *)&wd) + bytes_read, sizeof(wd) - bytes_read);
202 if (r > 0) bytes_read += r;
203 else if (r < 0) errcnt++;
204 }
205 if (errcnt >= 50)
206 {
207 fprintf(stderr,
208 "Error: Max. error count for pipe read "
209 "exceeded in OProcessController::slotDoHousekeeping\n");
210 return; // it makes no sense to continue here!
211 }
212 if (bytes_read != sizeof(wd))
213 {
214 fprintf(stderr,
215 "Error: Could not read info from signal handler %d <> %d!\n",
216 bytes_read, sizeof(wd));
217 return; // it makes no sense to continue here!
218 }
219 if (wd.pid==0)
220 { // special case, see delayedChildrenCleanup()
221 delayedChildrenCleanupTimer.start( 1000, true );
222 return;
223 }
224
225 for( QValueList<OProcess*>::ConstIterator it = processList.begin();
226 it != processList.end();
227 ++it )
228 {
229 OProcess* proc = *it;
230 if (proc->pid() == wd.pid)
231 {
232 // process has exited, so do emit the respective events
233 if (proc->run_mode == OProcess::Block)
234 {
235 // If the reads are done blocking then set the status in proc
236 // but do nothing else because OProcess will perform the other
237 // actions of processHasExited.
238 proc->status = wd.status;
239 proc->runs = false;
240 }
241 else
242 {
243 proc->processHasExited(wd.status);
244 }
245 return;
246 }
247 }
248}
249
250// this is needed e.g. for popen(), which calls waitpid() checking
251// for its forked child, if we did waitpid() directly in the SIGCHLD
252// handler, popen()'s waitpid() call would fail
253void OProcessController::delayedChildrenCleanup()
254{
255 struct waitdata wd;
256 while(( wd.pid = waitpid( -1, &wd.status, WNOHANG ) ) > 0 )
257 {
258 for( QValueList<OProcess*>::ConstIterator it = processList.begin();
259 it != processList.end();
260 ++it )
261 {
262 if( !(*it)->isRunning() || (*it)->pid() != wd.pid )
263 continue;
264 // it's OProcess, handle it
265 ::write(fd[1], &wd, sizeof(wd));
266 break;
267 }
268 }
269}
270
271OProcessController::~OProcessController()
272{
273 assert( theOProcessController == this );
274 resetHandlers();
275
276 notifier->setEnabled(false);
277
278 close(fd[0]);
279 close(fd[1]);
280
281 delete notifier;
282 theOProcessController = 0;
283}
284
285//#include "kprocctrl.moc"
diff --git a/microkde/oprocctrl.h b/microkde/oprocctrl.h
deleted file mode 100644
index ea00859..0000000
--- a/microkde/oprocctrl.h
+++ b/dev/null
@@ -1,129 +0,0 @@
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19//
20// KPROCESSCONTROLLER -- A helper class for KProcess
21//
22// version 0.3.1, Jan 8th 1997
23//
24// (C) Christian Czezatke
25// e9025461@student.tuwien.ac.at
26// Ported by Holger Freyther
27//
28
29#ifndef __KPROCCTRL_H__
30#define __KPROCCTRL_H__
31
32#include <qvaluelist.h>
33#include <qtimer.h>
34
35#include "oprocess.h"
36
37class QSocketNotifier;
38
39
40namespace Opie {
41namespace Core {
42namespace Internal {
43class OProcessControllerPrivate;
44
45/**
46 * @short Used internally by @ref OProcess
47 * @internal
48 * @author Christian Czezakte <e9025461@student.tuwien.ac.at>
49 *
50 * A class for internal use by OProcess only. -- Exactly one instance
51 * of this class is generated by the first instance of OProcess that is
52 * created (a pointer to it gets stored in @ref theOProcessController ).
53 *
54 * This class takes care of the actual (UN*X) signal handling.
55*/
56class OProcessController : public QObject
57{
58 Q_OBJECT
59
60public:
61 OProcessController();
62 ~OProcessController();
63 //CC: WARNING! Destructor Not virtual (but you don't derive classes from this anyhow...)
64
65public:
66
67 /**
68 * Only a single instance of this class is allowed at a time,
69 * and this static variable is used to track the one instance.
70 */
71 static OProcessController *theOProcessController;
72
73 /**
74 * Automatically called upon SIGCHLD.
75 *
76 * Normally you do not need to do anything with this function but
77 * if your application needs to disable SIGCHLD for some time for
78 * reasons beyond your control, you should call this function afterwards
79 * to make sure that no SIGCHLDs where missed.
80 */
81 static void theSigCHLDHandler(int signal);
82 // handler for sigchld
83
84 /**
85 * @internal
86 */
87 static void setupHandlers();
88 /**
89 * @internal
90 */
91 static void resetHandlers();
92 /**
93 * @internal
94 */
95 void addOProcess( OProcess* );
96 /**
97 * @internal
98 */
99 void removeOProcess( OProcess* );
100public slots:
101 /**
102 * @internal
103 */
104 void slotDoHousekeeping(int socket);
105
106private slots:
107 void delayedChildrenCleanup();
108private:
109 int fd[2];
110 QSocketNotifier *notifier;
111 static struct sigaction oldChildHandlerData;
112 static bool handlerSet;
113 QValueList<OProcess*> processList;
114 QTimer delayedChildrenCleanupTimer;
115
116 // Disallow assignment and copy-construction
117 OProcessController( const OProcessController& );
118 OProcessController& operator= ( const OProcessController& );
119
120 OProcessControllerPrivate *d;
121};
122
123}
124}
125}
126
127
128#endif
129
diff --git a/microkde/oprocess.cpp b/microkde/oprocess.cpp
deleted file mode 100644
index a935792..0000000
--- a/microkde/oprocess.cpp
+++ b/dev/null
@@ -1,952 +0,0 @@
1/*
2                This file is part of the Opie Project
3             Copyright (C) 2002-2004 Holger Freyther <zecke@handhelds.org>
4 and The Opie Team <opie-devel@handhelds.org>
5 =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at)
6 .=l.
7          .>+-=
8_;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12- .   .-<_>     .<> Foundation; either version 2 of the License,
13    ._= =}       : or (at your option) any later version.
14   .%`+i>       _;_.
15   .i_,=:_.      -<s. This program is distributed in the hope that
16    +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17   : ..    .:,     . . . without even the implied warranty of
18   =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19 _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22:     =  ...= . :.=-
23-.   .:....=;==+<; You should have received a copy of the GNU
24 -_. . .   )=.  = Library General Public License along with
25   --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#include "oprocctrl.h"
32
33/* OPIE */
34#include <oprocess.h>
35
36/* QT */
37
38#include <qapplication.h>
39#include <qdir.h>
40#include <qmap.h>
41#include <qregexp.h>
42#include <qsocketnotifier.h>
43#include <qtextstream.h>
44
45/* STD */
46#include <errno.h>
47#include <fcntl.h>
48#include <pwd.h>
49#include <stdlib.h>
50#include <signal.h>
51#include <stdio.h>
52#include <string.h>
53#include <sys/time.h>
54#include <sys/types.h>
55#include <sys/stat.h>
56#include <sys/socket.h>
57#include <unistd.h>
58#ifdef HAVE_SYS_SELECT_H
59#include <sys/select.h>
60#endif
61#ifdef HAVE_INITGROUPS
62#include <grp.h>
63#endif
64
65using namespace Opie::Core::Internal;
66
67namespace Opie {
68namespace Core {
69namespace Internal {
70class OProcessPrivate
71{
72public:
73 OProcessPrivate() : useShell( false )
74 { }
75
76 bool useShell;
77 QMap<QString, QString> env;
78 QString wd;
79 QCString shell;
80};
81}
82
83OProcess::OProcess( QObject *parent, const char *name )
84 : QObject( parent, name )
85{
86 init ( );
87}
88
89OProcess::OProcess( const QString &arg0, QObject *parent, const char *name )
90 : QObject( parent, name )
91{
92 init ( );
93 *this << arg0;
94}
95
96OProcess::OProcess( const QStringList &args, QObject *parent, const char *name )
97 : QObject( parent, name )
98{
99 init ( );
100 *this << args;
101}
102
103void OProcess::init ( )
104{
105 run_mode = NotifyOnExit;
106 runs = false;
107 pid_ = 0;
108 status = 0;
109 keepPrivs = false;
110 innot = 0;
111 outnot = 0;
112 errnot = 0;
113 communication = NoCommunication;
114 input_data = 0;
115 input_sent = 0;
116 input_total = 0;
117 d = 0;
118
119 if ( 0 == OProcessController::theOProcessController )
120 {
121 ( void ) new OProcessController();
122 CHECK_PTR( OProcessController::theOProcessController );
123 }
124
125 OProcessController::theOProcessController->addOProcess( this );
126 out[ 0 ] = out[ 1 ] = -1;
127 in[ 0 ] = in[ 1 ] = -1;
128 err[ 0 ] = err[ 1 ] = -1;
129}
130
131void OProcess::setEnvironment( const QString &name, const QString &value )
132{
133 if ( !d )
134 d = new OProcessPrivate;
135 d->env.insert( name, value );
136}
137
138void OProcess::setWorkingDirectory( const QString &dir )
139{
140 if ( !d )
141 d = new OProcessPrivate;
142 d->wd = dir;
143}
144
145void OProcess::setupEnvironment()
146{
147 if ( d )
148 {
149 QMap<QString, QString>::Iterator it;
150 for ( it = d->env.begin(); it != d->env.end(); ++it )
151 setenv( QFile::encodeName( it.key() ).data(),
152 QFile::encodeName( it.data() ).data(), 1 );
153 if ( !d->wd.isEmpty() )
154 chdir( QFile::encodeName( d->wd ).data() );
155 }
156}
157
158void OProcess::setRunPrivileged( bool keepPrivileges )
159{
160 keepPrivs = keepPrivileges;
161}
162
163bool OProcess::runPrivileged() const
164{
165 return keepPrivs;
166}
167
168OProcess::~OProcess()
169{
170 // destroying the OProcess instance sends a SIGKILL to the
171 // child process (if it is running) after removing it from the
172 // list of valid processes (if the process is not started as
173 // "DontCare")
174
175 OProcessController::theOProcessController->removeOProcess( this );
176 // this must happen before we kill the child
177 // TODO: block the signal while removing the current process from the process list
178
179 if ( runs && ( run_mode != DontCare ) )
180 kill( SIGKILL );
181
182 // Clean up open fd's and socket notifiers.
183 closeStdin();
184 closeStdout();
185 closeStderr();
186
187 // TODO: restore SIGCHLD and SIGPIPE handler if this is the last OProcess
188 delete d;
189}
190
191void OProcess::detach()
192{
193 OProcessController::theOProcessController->removeOProcess( this );
194
195 runs = false;
196 pid_ = 0;
197
198 // Clean up open fd's and socket notifiers.
199 closeStdin();
200 closeStdout();
201 closeStderr();
202}
203
204bool OProcess::setExecutable( const QString& proc )
205{
206 if ( runs )
207 return false;
208
209 if ( proc.isEmpty() )
210 return false;
211
212 if ( !arguments.isEmpty() )
213 arguments.remove( arguments.begin() );
214 arguments.prepend( QFile::encodeName( proc ) );
215
216 return true;
217}
218
219OProcess &OProcess::operator<<( const QStringList& args )
220{
221 QStringList::ConstIterator it = args.begin();
222 for ( ; it != args.end() ; ++it )
223 arguments.append( QFile::encodeName( *it ) );
224 return *this;
225}
226
227OProcess &OProcess::operator<<( const QCString& arg )
228{
229 return operator<< ( arg.data() );
230}
231
232OProcess &OProcess::operator<<( const char* arg )
233{
234 arguments.append( arg );
235 return *this;
236}
237
238OProcess &OProcess::operator<<( const QString& arg )
239{
240 arguments.append( QFile::encodeName( arg ) );
241 return *this;
242}
243
244void OProcess::clearArguments()
245{
246 arguments.clear();
247}
248
249bool OProcess::start( RunMode runmode, Communication comm )
250{
251 uint i;
252 uint n = arguments.count();
253 char **arglist;
254
255 if ( runs || ( 0 == n ) )
256 {
257 return false; // cannot start a process that is already running
258 // or if no executable has been assigned
259 }
260 run_mode = runmode;
261 status = 0;
262
263 QCString shellCmd;
264 if ( d && d->useShell )
265 {
266 if ( d->shell.isEmpty() )
267 {
268 qWarning( "Could not find a valid shell" );
269 return false;
270 }
271
272 arglist = static_cast<char **>( malloc( ( 4 ) * sizeof( char * ) ) );
273 for ( i = 0; i < n; i++ )
274 {
275 shellCmd += arguments[ i ];
276 shellCmd += " "; // CC: to separate the arguments
277 }
278
279 arglist[ 0 ] = d->shell.data();
280 arglist[ 1 ] = ( char * ) "-c";
281 arglist[ 2 ] = shellCmd.data();
282 arglist[ 3 ] = 0;
283 }
284 else
285 {
286 arglist = static_cast<char **>( malloc( ( n + 1 ) * sizeof( char * ) ) );
287 for ( i = 0; i < n; i++ )
288 arglist[ i ] = arguments[ i ].data();
289 arglist[ n ] = 0;
290 }
291
292 if ( !setupCommunication( comm ) )
293 qWarning( "Could not setup Communication!" );
294
295 // We do this in the parent because if we do it in the child process
296 // gdb gets confused when the application runs from gdb.
297 uid_t uid = getuid();
298 gid_t gid = getgid();
299#ifdef HAVE_INITGROUPS
300
301 struct passwd *pw = getpwuid( uid );
302#endif
303
304 int fd[ 2 ];
305 if ( 0 > pipe( fd ) )
306 {
307 fd[ 0 ] = fd[ 1 ] = 0; // Pipe failed.. continue
308 }
309
310 runs = true;
311
312 QApplication::flushX();
313
314 // WABA: Note that we use fork() and not vfork() because
315 // vfork() has unclear semantics and is not standardized.
316 pid_ = fork();
317
318 if ( 0 == pid_ )
319 {
320 if ( fd[ 0 ] )
321 close( fd[ 0 ] );
322 if ( !runPrivileged() )
323 {
324 setgid( gid );
325#if defined( HAVE_INITGROUPS)
326
327 if ( pw )
328 initgroups( pw->pw_name, pw->pw_gid );
329#endif
330
331 setuid( uid );
332 }
333 // The child process
334 if ( !commSetupDoneC() )
335 qWarning( "Could not finish comm setup in child!" );
336
337 setupEnvironment();
338
339 // Matthias
340 if ( run_mode == DontCare )
341 setpgid( 0, 0 );
342 // restore default SIGPIPE handler (Harri)
343 struct sigaction act;
344 sigemptyset( &( act.sa_mask ) );
345 sigaddset( &( act.sa_mask ), SIGPIPE );
346 act.sa_handler = SIG_DFL;
347 act.sa_flags = 0;
348 sigaction( SIGPIPE, &act, 0L );
349
350 // We set the close on exec flag.
351 // Closing of fd[1] indicates that the execvp succeeded!
352 if ( fd[ 1 ] )
353 fcntl( fd[ 1 ], F_SETFD, FD_CLOEXEC );
354 execvp( arglist[ 0 ], arglist );
355 char resultByte = 1;
356 if ( fd[ 1 ] )
357 write( fd[ 1 ], &resultByte, 1 );
358 _exit( -1 );
359 }
360 else if ( -1 == pid_ )
361 {
362 // forking failed
363
364 runs = false;
365 free( arglist );
366 return false;
367 }
368 else
369 {
370 if ( fd[ 1 ] )
371 close( fd[ 1 ] );
372 // the parent continues here
373
374 // Discard any data for stdin that might still be there
375 input_data = 0;
376
377 // Check whether client could be started.
378 if ( fd[ 0 ] )
379 for ( ;; )
380 {
381 char resultByte;
382 int n = ::read( fd[ 0 ], &resultByte, 1 );
383 if ( n == 1 )
384 {
385 // Error
386 runs = false;
387 close( fd[ 0 ] );
388 free( arglist );
389 pid_ = 0;
390 return false;
391 }
392 if ( n == -1 )
393 {
394 if ( ( errno == ECHILD ) || ( errno == EINTR ) )
395 continue; // Ignore
396 }
397 break; // success
398 }
399 if ( fd[ 0 ] )
400 close( fd[ 0 ] );
401
402 if ( !commSetupDoneP() ) // finish communication socket setup for the parent
403 qWarning( "Could not finish comm setup in parent!" );
404
405 if ( run_mode == Block )
406 {
407 commClose();
408
409 // The SIGCHLD handler of the process controller will catch
410 // the exit and set the status
411 while ( runs )
412 {
413 OProcessController::theOProcessController->
414 slotDoHousekeeping( 0 );
415 }
416 runs = FALSE;
417 emit processExited( this );
418 }
419 }
420 free( arglist );
421 return true;
422}
423
424
425
426bool OProcess::kill( int signo )
427{
428 bool rv = false;
429
430 if ( 0 != pid_ )
431 rv = ( -1 != ::kill( pid_, signo ) );
432 // probably store errno somewhere...
433 return rv;
434}
435
436bool OProcess::isRunning() const
437{
438 return runs;
439}
440
441pid_t OProcess::pid() const
442{
443 return pid_;
444}
445
446bool OProcess::normalExit() const
447{
448 int _status = status;
449 return ( pid_ != 0 ) && ( !runs ) && ( WIFEXITED( ( _status ) ) );
450}
451
452int OProcess::exitStatus() const
453{
454 int _status = status;
455 return WEXITSTATUS( ( _status ) );
456}
457
458bool OProcess::writeStdin( const char *buffer, int buflen )
459{
460 bool rv;
461
462 // if there is still data pending, writing new data
463 // to stdout is not allowed (since it could also confuse
464 // kprocess...
465 if ( 0 != input_data )
466 return false;
467
468 if ( runs && ( communication & Stdin ) )
469 {
470 input_data = buffer;
471 input_sent = 0;
472 input_total = buflen;
473 slotSendData( 0 );
474 innot->setEnabled( true );
475 rv = true;
476 }
477 else
478 rv = false;
479 return rv;
480}
481
482void OProcess::flushStdin ( )
483{
484 if ( !input_data || ( input_sent == input_total ) )
485 return ;
486
487 int d1, d2;
488
489 do
490 {
491 d1 = input_total - input_sent;
492 slotSendData ( 0 );
493 d2 = input_total - input_sent;
494 }
495 while ( d2 <= d1 );
496}
497
498void OProcess::suspend()
499{
500 if ( ( communication & Stdout ) && outnot )
501 outnot->setEnabled( false );
502}
503
504void OProcess::resume()
505{
506 if ( ( communication & Stdout ) && outnot )
507 outnot->setEnabled( true );
508}
509
510bool OProcess::closeStdin()
511{
512 bool rv;
513
514 if ( communication & Stdin )
515 {
516 communication = ( Communication ) ( communication & ~Stdin );
517 delete innot;
518 innot = 0;
519 close( in[ 1 ] );
520 rv = true;
521 }
522 else
523 rv = false;
524 return rv;
525}
526
527bool OProcess::closeStdout()
528{
529 bool rv;
530
531 if ( communication & Stdout )
532 {
533 communication = ( Communication ) ( communication & ~Stdout );
534 delete outnot;
535 outnot = 0;
536 close( out[ 0 ] );
537 rv = true;
538 }
539 else
540 rv = false;
541 return rv;
542}
543
544bool OProcess::closeStderr()
545{
546 bool rv;
547
548 if ( communication & Stderr )
549 {
550 communication = static_cast<Communication>( communication & ~Stderr );
551 delete errnot;
552 errnot = 0;
553 close( err[ 0 ] );
554 rv = true;
555 }
556 else
557 rv = false;
558 return rv;
559}
560
561void OProcess::slotChildOutput( int fdno )
562{
563 if ( !childOutput( fdno ) )
564 closeStdout();
565}
566
567void OProcess::slotChildError( int fdno )
568{
569 if ( !childError( fdno ) )
570 closeStderr();
571}
572
573void OProcess::slotSendData( int )
574{
575 if ( input_sent == input_total )
576 {
577 innot->setEnabled( false );
578 input_data = 0;
579 emit wroteStdin( this );
580 }
581 else
582 input_sent += ::write( in[ 1 ], input_data + input_sent, input_total - input_sent );
583}
584
585void OProcess::processHasExited( int state )
586{
587 if ( runs )
588 {
589 runs = false;
590 status = state;
591
592 commClose(); // cleanup communication sockets
593
594 // also emit a signal if the process was run Blocking
595 if ( DontCare != run_mode )
596 {
597 emit processExited( this );
598 }
599 }
600}
601
602int OProcess::childOutput( int fdno )
603{
604 if ( communication & NoRead )
605 {
606 int len = -1;
607 emit receivedStdout( fdno, len );
608 errno = 0; // Make sure errno doesn't read "EAGAIN"
609 return len;
610 }
611 else
612 {
613 char buffer[ 1024 ];
614 int len;
615
616 len = ::read( fdno, buffer, 1024 );
617
618 if ( 0 < len )
619 {
620 emit receivedStdout( this, buffer, len );
621 }
622 return len;
623 }
624}
625
626int OProcess::childError( int fdno )
627{
628 char buffer[ 1024 ];
629 int len;
630
631 len = ::read( fdno, buffer, 1024 );
632
633 if ( 0 < len )
634 emit receivedStderr( this, buffer, len );
635 return len;
636}
637
638int OProcess::setupCommunication( Communication comm )
639{
640 int ok;
641
642 communication = comm;
643
644 ok = 1;
645 if ( comm & Stdin )
646 ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, in ) >= 0;
647
648 if ( comm & Stdout )
649 ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, out ) >= 0;
650
651 if ( comm & Stderr )
652 ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, err ) >= 0;
653
654 return ok;
655}
656
657int OProcess::commSetupDoneP()
658{
659 int ok = 1;
660
661 if ( communication != NoCommunication )
662 {
663 if ( communication & Stdin )
664 close( in[ 0 ] );
665 if ( communication & Stdout )
666 close( out[ 1 ] );
667 if ( communication & Stderr )
668 close( err[ 1 ] );
669
670 // Don't create socket notifiers and set the sockets non-blocking if
671 // blocking is requested.
672 if ( run_mode == Block )
673 return ok;
674
675 if ( communication & Stdin )
676 {
677 // ok &= (-1 != fcntl(in[1], F_SETFL, O_NONBLOCK));
678 innot = new QSocketNotifier( in[ 1 ], QSocketNotifier::Write, this );
679 CHECK_PTR( innot );
680 innot->setEnabled( false ); // will be enabled when data has to be sent
681 QObject::connect( innot, SIGNAL( activated(int) ),
682 this, SLOT( slotSendData(int) ) );
683 }
684
685 if ( communication & Stdout )
686 {
687 // ok &= (-1 != fcntl(out[0], F_SETFL, O_NONBLOCK));
688 outnot = new QSocketNotifier( out[ 0 ], QSocketNotifier::Read, this );
689 CHECK_PTR( outnot );
690 QObject::connect( outnot, SIGNAL( activated(int) ),
691 this, SLOT( slotChildOutput(int) ) );
692 if ( communication & NoRead )
693 suspend();
694 }
695
696 if ( communication & Stderr )
697 {
698 // ok &= (-1 != fcntl(err[0], F_SETFL, O_NONBLOCK));
699 errnot = new QSocketNotifier( err[ 0 ], QSocketNotifier::Read, this );
700 CHECK_PTR( errnot );
701 QObject::connect( errnot, SIGNAL( activated(int) ),
702 this, SLOT( slotChildError(int) ) );
703 }
704 }
705 return ok;
706}
707
708int OProcess::commSetupDoneC()
709{
710 int ok = 1;
711 struct linger so;
712 memset( &so, 0, sizeof( so ) );
713
714 if ( communication & Stdin )
715 close( in[ 1 ] );
716 if ( communication & Stdout )
717 close( out[ 0 ] );
718 if ( communication & Stderr )
719 close( err[ 0 ] );
720
721 if ( communication & Stdin )
722 ok &= dup2( in[ 0 ], STDIN_FILENO ) != -1;
723 else
724 {
725 int null_fd = open( "/dev/null", O_RDONLY );
726 ok &= dup2( null_fd, STDIN_FILENO ) != -1;
727 close( null_fd );
728 }
729 if ( communication & Stdout )
730 {
731 ok &= dup2( out[ 1 ], STDOUT_FILENO ) != -1;
732 ok &= !setsockopt( out[ 1 ], SOL_SOCKET, SO_LINGER, ( char* ) & so, sizeof( so ) );
733 }
734 else
735 {
736 int null_fd = open( "/dev/null", O_WRONLY );
737 ok &= dup2( null_fd, STDOUT_FILENO ) != -1;
738 close( null_fd );
739 }
740 if ( communication & Stderr )
741 {
742 ok &= dup2( err[ 1 ], STDERR_FILENO ) != -1;
743 ok &= !setsockopt( err[ 1 ], SOL_SOCKET, SO_LINGER, reinterpret_cast<char *>( &so ), sizeof( so ) );
744 }
745 else
746 {
747 int null_fd = open( "/dev/null", O_WRONLY );
748 ok &= dup2( null_fd, STDERR_FILENO ) != -1;
749 close( null_fd );
750 }
751 return ok;
752}
753
754void OProcess::commClose()
755{
756 if ( NoCommunication != communication )
757 {
758 bool b_in = ( communication & Stdin );
759 bool b_out = ( communication & Stdout );
760 bool b_err = ( communication & Stderr );
761 if ( b_in )
762 delete innot;
763
764 if ( b_out || b_err )
765 {
766 // If both channels are being read we need to make sure that one socket buffer
767 // doesn't fill up whilst we are waiting for data on the other (causing a deadlock).
768 // Hence we need to use select.
769
770 // Once one or other of the channels has reached EOF (or given an error) go back
771 // to the usual mechanism.
772
773 int fds_ready = 1;
774 fd_set rfds;
775
776 int max_fd = 0;
777 if ( b_out )
778 {
779 fcntl( out[ 0 ], F_SETFL, O_NONBLOCK );
780 if ( out[ 0 ] > max_fd )
781 max_fd = out[ 0 ];
782 delete outnot;
783 outnot = 0;
784 }
785 if ( b_err )
786 {
787 fcntl( err[ 0 ], F_SETFL, O_NONBLOCK );
788 if ( err[ 0 ] > max_fd )
789 max_fd = err[ 0 ];
790 delete errnot;
791 errnot = 0;
792 }
793
794
795 while ( b_out || b_err )
796 {
797 // * If the process is still running we block until we
798 // receive data. (p_timeout = 0, no timeout)
799 // * If the process has already exited, we only check
800 // the available data, we don't wait for more.
801 // (p_timeout = &timeout, timeout immediately)
802 struct timeval timeout;
803 timeout.tv_sec = 0;
804 timeout.tv_usec = 0;
805 struct timeval *p_timeout = runs ? 0 : &timeout;
806
807 FD_ZERO( &rfds );
808 if ( b_out )
809 FD_SET( out[ 0 ], &rfds );
810
811 if ( b_err )
812 FD_SET( err[ 0 ], &rfds );
813
814 fds_ready = select( max_fd + 1, &rfds, 0, 0, p_timeout );
815 if ( fds_ready <= 0 )
816 break;
817
818 if ( b_out && FD_ISSET( out[ 0 ], &rfds ) )
819 {
820 int ret = 1;
821 while ( ret > 0 )
822 ret = childOutput( out[ 0 ] );
823 if ( ( ret == -1 && errno != EAGAIN ) || ret == 0 )
824 b_out = false;
825 }
826
827 if ( b_err && FD_ISSET( err[ 0 ], &rfds ) )
828 {
829 int ret = 1;
830 while ( ret > 0 )
831 ret = childError( err[ 0 ] );
832 if ( ( ret == -1 && errno != EAGAIN ) || ret == 0 )
833 b_err = false;
834 }
835 }
836 }
837
838 if ( b_in )
839 {
840 communication = ( Communication ) ( communication & ~Stdin );
841 close( in[ 1 ] );
842 }
843 if ( b_out )
844 {
845 communication = ( Communication ) ( communication & ~Stdout );
846 close( out[ 0 ] );
847 }
848 if ( b_err )
849 {
850 communication = ( Communication ) ( communication & ~Stderr );
851 close( err[ 0 ] );
852 }
853 }
854}
855
856void OProcess::setUseShell( bool useShell, const char *shell )
857{
858 if ( !d )
859 d = new OProcessPrivate;
860 d->useShell = useShell;
861 d->shell = shell;
862 if ( d->shell.isEmpty() )
863 d->shell = searchShell();
864}
865
866QString OProcess::quote( const QString &arg )
867{
868 QString res = arg;
869 res.replace( QRegExp( QString::fromLatin1( "\'" ) ),
870 QString::fromLatin1( "'\"'\"'" ) );
871 res.prepend( '\'' );
872 res.append( '\'' );
873 return res;
874}
875
876QCString OProcess::searchShell()
877{
878 QCString tmpShell = QCString( getenv( "SHELL" ) ).stripWhiteSpace();
879 if ( !isExecutable( tmpShell ) )
880 {
881 tmpShell = "/bin/sh";
882 }
883
884 return tmpShell;
885}
886
887bool OProcess::isExecutable( const QCString &filename )
888{
889 struct stat fileinfo;
890
891 if ( filename.isEmpty() )
892 return false;
893
894 // CC: we've got a valid filename, now let's see whether we can execute that file
895
896 if ( -1 == stat( filename.data(), &fileinfo ) )
897 return false;
898 // CC: return false if the file does not exist
899
900 // CC: anyway, we cannot execute directories, block/character devices, fifos or sockets
901 if ( ( S_ISDIR( fileinfo.st_mode ) ) ||
902 ( S_ISCHR( fileinfo.st_mode ) ) ||
903 ( S_ISBLK( fileinfo.st_mode ) ) ||
904#ifdef S_ISSOCK
905 // CC: SYSVR4 systems don't have that macro
906 ( S_ISSOCK( fileinfo.st_mode ) ) ||
907#endif
908 ( S_ISFIFO( fileinfo.st_mode ) ) ||
909 ( S_ISDIR( fileinfo.st_mode ) ) )
910 {
911 return false;
912 }
913
914 // CC: now check for permission to execute the file
915 if ( access( filename.data(), X_OK ) != 0 )
916 return false;
917
918 // CC: we've passed all the tests...
919 return true;
920}
921
922int OProcess::processPID( const QString& process )
923{
924 QString line;
925 QDir d = QDir( "/proc" );
926 QStringList dirs = d.entryList( QDir::Dirs );
927 QStringList::Iterator it;
928 for ( it = dirs.begin(); it != dirs.end(); ++it )
929 {
930 //qDebug( "next entry: %s", (const char*) *it );
931 QFile file( "/proc/"+*it+"/cmdline" );
932 file.open( IO_ReadOnly );
933 if ( !file.isOpen() ) continue;
934 QTextStream t( &file );
935 line = t.readLine();
936 //qDebug( "cmdline = %s", (const char*) line );
937 if ( line.contains( process ) ) break; //FIXME: That may find also other process, if the name is not long enough ;)
938 }
939 if ( line.contains( process ) )
940 {
941 //qDebug( "found process id #%d", (*it).toInt() );
942 return (*it).toInt();
943 }
944 else
945 {
946 //qDebug( "process '%s' not found", (const char*) process );
947 return 0;
948 }
949}
950
951}
952}
diff --git a/microkde/oprocess.h b/microkde/oprocess.h
deleted file mode 100644
index be1436c..0000000
--- a/microkde/oprocess.h
+++ b/dev/null
@@ -1,761 +0,0 @@
1/*
2                This file is part of the Opie Project
3             Copyright (C) 2003-2004 Holger Freyther <zecke@handhelds.org>
4 Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at)
6 .=l.
7          .>+-=
8_;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12- .   .-<_>     .<> Foundation; either version 2 of the License,
13    ._= =}       : or (at your option) any later version.
14   .%`+i>       _;_.
15   .i_,=:_.      -<s. This program is distributed in the hope that
16    +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17   : ..    .:,     . . . without even the implied warranty of
18   =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19 _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22:     =  ...= . :.=-
23-.   .:....=;==+<; You should have received a copy of the GNU
24 -_. . .   )=.  = Library General Public License along with
25   --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29*/
30
31#ifndef OPROCESS_H
32#define OPROCESS_H
33
34/* QT */
35#include <qcstring.h>
36#include <qobject.h>
37#include <qvaluelist.h>
38
39/* STD */
40#include <sys/types.h> // for pid_t
41#include <sys/wait.h>
42#include <signal.h>
43#include <unistd.h>
44
45class QSocketNotifier;
46
47namespace Opie {
48namespace Core {
49namespace Internal {
50class OProcessController;
51class OProcessPrivate;
52}
53
54/**
55 * Child process invocation, monitoring and control.
56 *
57 * @sect General usage and features
58 *
59 *This class allows a KDE and OPIE application to start child processes without having
60 *to worry about UN*X signal handling issues and zombie process reaping.
61 *
62 *@see KProcIO
63 *
64 *Basically, this class distinguishes three different ways of running
65 *child processes:
66 *
67 *@li OProcess::DontCare -- The child process is invoked and both the child
68 *process and the parent process continue concurrently.
69 *
70 *Starting a DontCare child process means that the application is
71 *not interested in any notification to determine whether the
72 *child process has already exited or not.
73 *
74 *@li OProcess::NotifyOnExit -- The child process is invoked and both the
75 *child and the parent process run concurrently.
76 *
77 *When the child process exits, the OProcess instance
78 *corresponding to it emits the Qt signal @ref processExited().
79 *
80 *Since this signal is @em not emitted from within a UN*X
81 *signal handler, arbitrary function calls can be made.
82 *
83 *Be aware: When the OProcess objects gets destructed, the child
84 *process will be killed if it is still running!
85 *This means in particular, that you cannot use a OProcess on the stack
86 *with OProcess::NotifyOnExit.
87 *
88 *@li OProcess::Block -- The child process starts and the parent process
89 *is suspended until the child process exits. (@em Really not recommended
90 *for programs with a GUI.)
91 *
92 *OProcess also provides several functions for determining the exit status
93 *and the pid of the child process it represents.
94 *
95 *Furthermore it is possible to supply command-line arguments to the process
96 *in a clean fashion (no null -- terminated stringlists and such...)
97 *
98 *A small usage example:
99 *<pre>
100 *OProcess *proc = new OProcess;
101 *
102 **proc << "my_executable";
103 **proc << "These" << "are" << "the" << "command" << "line" << "args";
104 *QApplication::connect(proc, SIGNAL(processExited(Opie::Core::OProcess *)),
105 * pointer_to_my_object, SLOT(my_objects_slot(Opie::Core::OProcess *)));
106 *proc->start();
107 *</pre>
108 *
109 *This will start "my_executable" with the commandline arguments "These"...
110 *
111 *When the child process exits, the respective Qt signal will be emitted.
112 *
113 *@sect Communication with the child process
114 *
115 *OProcess supports communication with the child process through
116 *stdin/stdout/stderr.
117 *
118 *The following functions are provided for getting data from the child
119 *process or sending data to the child's stdin (For more information,
120 *have a look at the documentation of each function):
121 *
122 *@li bool @ref writeStdin(char *buffer, int buflen);
123 *@li -- Transmit data to the child process's stdin.
124 *
125 *@li bool @ref closeStdin();
126 *@li -- Closes the child process's stdin (which causes it to see an feof(stdin)).
127 *Returns false if you try to close stdin for a process that has been started
128 *without a communication channel to stdin.
129 *
130 *@li bool @ref closeStdout();
131 *@li -- Closes the child process's stdout.
132 *Returns false if you try to close stdout for a process that has been started
133 *without a communication channel to stdout.
134 *
135 *@li bool @ref closeStderr();
136 *@li -- Closes the child process's stderr.
137 *Returns false if you try to close stderr for a process that has been started
138 *without a communication channel to stderr.
139 *
140 *
141 *@sect QT signals:
142 *
143 *@li void @ref receivedStdout(OProcess *proc, char *buffer, int buflen);
144 *@li void @ref receivedStderr(OProcess *proc, char *buffer, int buflen);
145 *@li -- Indicates that new data has arrived from either the
146 *child process's stdout or stderr.
147 *
148 *@li void @ref wroteStdin(OProcess *proc);
149 *@li -- Indicates that all data that has been sent to the child process
150 *by a prior call to @ref writeStdin() has actually been transmitted to the
151 *client .
152 *
153 *@author Christian Czezakte e9025461@student.tuwien.ac.at
154 *@author Holger Freyther (Opie Port)
155 *
156 **/
157class OProcess : public QObject
158{
159 Q_OBJECT
160
161public:
162
163 /**
164 * Modes in which the communication channel can be opened.
165 *
166 * If communication for more than one channel is required,
167 * the values have to be or'ed together, for example to get
168 * communication with stdout as well as with stdin, you would
169 * specify @p Stdin @p | @p Stdout
170 *
171 * If @p NoRead is specified in conjunction with @p Stdout,
172 * no data is actually read from @p Stdout but only
173 * the signal @ref childOutput(int fd) is emitted.
174 */
175 enum Communication { NoCommunication = 0, Stdin = 1, Stdout = 2, Stderr = 4,
176 AllOutput = 6, All = 7,
177 NoRead };
178
179 /**
180 * Run-modes for a child process.
181 */
182 enum RunMode {
183 /**
184 * The application does not receive notifications from the subprocess when
185 * it is finished or aborted.
186 */
187 DontCare,
188 /**
189 * The application is notified when the subprocess dies.
190 */
191 NotifyOnExit,
192 /**
193 * The application is suspended until the started process is finished.
194 */
195 Block };
196
197 /**
198 * Constructor
199 */
200 OProcess( QObject *parent = 0, const char *name = 0 );
201 /**
202 * Constructor
203 */
204 OProcess( const QString &arg0, QObject *parent = 0, const char *name = 0 );
205 /**
206 * Constructor
207 */
208 OProcess( const QStringList &args, QObject *parent = 0, const char *name = 0 );
209
210 /**
211 *Destructor:
212 *
213 * If the process is running when the destructor for this class
214 * is called, the child process is killed with a SIGKILL, but
215 * only if the run mode is not of type @p DontCare.
216 * Processes started as @p DontCare keep running anyway.
217 */
218 virtual ~OProcess();
219
220 /**
221 @deprecated
222
223 The use of this function is now deprecated. -- Please use the
224 "operator<<" instead of "setExecutable".
225
226 Sets the executable to be started with this OProcess object.
227 Returns false if the process is currently running (in that
228 case the executable remains unchanged.)
229
230 @see operator<<
231
232 */
233 bool setExecutable( const QString& proc );
234
235
236 /**
237 * Sets the executable and the command line argument list for this process.
238 *
239 * For example, doing an "ls -l /usr/local/bin" can be achieved by:
240 * <pre>
241 * OProcess p;
242 * ...
243 * p << "ls" << "-l" << "/usr/local/bin"
244 * </pre>
245 *
246 **/
247 OProcess &operator<<( const QString& arg );
248 /**
249 * Similar to previous method, takes a char *, supposed to be in locale 8 bit already.
250 */
251 OProcess &operator<<( const char * arg );
252 /**
253 * Similar to previous method, takes a QCString, supposed to be in locale 8 bit already.
254 */
255 OProcess &operator<<( const QCString & arg );
256
257 /**
258 * Sets the executable and the command line argument list for this process,
259 * in a single method call, or add a list of arguments.
260 **/
261 OProcess &operator<<( const QStringList& args );
262
263 /**
264 * Clear a command line argument list that has been set by using
265 * the "operator<<".
266 */
267 void clearArguments();
268
269 /**
270 * Starts the process.
271 * For a detailed description of the
272 * various run modes and communication semantics, have a look at the
273 * general description of the OProcess class.
274 *
275 * The following problems could cause this function to
276 * return false:
277 *
278 * @li The process is already running.
279 * @li The command line argument list is empty.
280 * @li The starting of the process failed (could not fork).
281 * @li The executable was not found.
282 *
283 * @param comm Specifies which communication links should be
284 * established to the child process (stdin/stdout/stderr). By default,
285 * no communication takes place and the respective communication
286 * signals will never get emitted.
287 *
288 * @return true on success, false on error
289 * (see above for error conditions)
290 **/
291 virtual bool start( RunMode runmode = NotifyOnExit,
292 Communication comm = NoCommunication );
293
294 /**
295 * Stop the process (by sending it a signal).
296 *
297 * @param signoThe signal to send. The default is SIGTERM.
298 * @return @p true if the signal was delivered successfully.
299 */
300 virtual bool kill( int signo = SIGTERM );
301
302 /**
303 @return @p true if the process is (still) considered to be running
304 */
305 bool isRunning() const;
306
307 /** Returns the process id of the process.
308 *
309 * If it is called after
310 * the process has exited, it returns the process id of the last
311 * child process that was created by this instance of OProcess.
312 *
313 * Calling it before any child process has been started by this
314 * OProcess instance causes pid() to return 0.
315 **/
316 pid_t pid() const;
317
318 /**
319 * Suspend processing of data from stdout of the child process.
320 */
321 void suspend();
322
323 /**
324 * Resume processing of data from stdout of the child process.
325 */
326 void resume();
327
328 /**
329 * @return @p true if the process has already finished and has exited
330 * "voluntarily", ie: it has not been killed by a signal.
331 *
332 * Note that you should check @ref OProcess::exitStatus() to determine
333 * whether the process completed its task successful or not.
334 */
335 bool normalExit() const;
336
337 /**
338 * Returns the exit status of the process.
339 *
340 * Please use
341 * @ref OProcess::normalExit() to check whether the process has exited
342 * cleanly (i.e., @ref OProcess::normalExit() returns @p true) before calling
343 * this function because if the process did not exit normally,
344 * it does not have a valid exit status.
345 */
346 int exitStatus() const;
347
348
349 /**
350 * Transmit data to the child process's stdin.
351 *
352 * OProcess::writeStdin may return false in the following cases:
353 *
354 * @li The process is not currently running.
355 *
356 * @li Communication to stdin has not been requested in the @ref start() call.
357 *
358 * @li Transmission of data to the child process by a previous call to
359 * @ref writeStdin() is still in progress.
360 *
361 * Please note that the data is sent to the client asynchronously,
362 * so when this function returns, the data might not have been
363 * processed by the child process.
364 *
365 * If all the data has been sent to the client, the signal
366 * @ref wroteStdin() will be emitted.
367 *
368 * Please note that you must not free "buffer" or call @ref writeStdin()
369 * again until either a @ref wroteStdin() signal indicates that the
370 * data has been sent or a @ref processHasExited() signal shows that
371 * the child process is no longer alive...
372 **/
373 bool writeStdin( const char *buffer, int buflen );
374
375 void flushStdin();
376
377 /**
378 * This causes the stdin file descriptor of the child process to be
379 * closed indicating an "EOF" to the child.
380 *
381 * @return @p false if no communication to the process's stdin
382 * had been specified in the call to @ref start().
383 */
384 bool closeStdin();
385
386 /**
387 * This causes the stdout file descriptor of the child process to be
388 * closed.
389 *
390 * @return @p false if no communication to the process's stdout
391 * had been specified in the call to @ref start().
392 */
393 bool closeStdout();
394
395 /**
396 * This causes the stderr file descriptor of the child process to be
397 * closed.
398 *
399 * @return @p false if no communication to the process's stderr
400 * had been specified in the call to @ref start().
401 */
402 bool closeStderr();
403
404 /**
405 * Lets you see what your arguments are for debugging.
406 * \todo make const
407 */
408
409 const QValueList<QCString> &args()
410 {
411 return arguments;
412 }
413
414 /**
415 * Controls whether the started process should drop any
416 * setuid/segid privileges or whether it should keep them
417 *
418 * The default is @p false : drop privileges
419 */
420 void setRunPrivileged( bool keepPrivileges );
421
422 /**
423 * Returns whether the started process will drop any
424 * setuid/segid privileges or whether it will keep them
425 */
426 bool runPrivileged() const;
427
428 /**
429 * Modifies the environment of the process to be started.
430 * This function must be called before starting the process.
431 */
432 void setEnvironment( const QString &name, const QString &value );
433
434 /**
435 * Changes the current working directory (CWD) of the process
436 * to be started.
437 * This function must be called before starting the process.
438 */
439 void setWorkingDirectory( const QString &dir );
440
441 /**
442 * Specify whether to start the command via a shell or directly.
443 * The default is to start the command directly.
444 * If @p useShell is true @p shell will be used as shell, or
445 * if shell is empty, the standard shell is used.
446 * @p quote A flag indicating whether to quote the arguments.
447 *
448 * When using a shell, the caller should make sure that all filenames etc.
449 * are properly quoted when passed as argument.
450 * @see quote()
451 */
452 void setUseShell( bool useShell, const char *shell = 0 );
453
454 /**
455 * This function can be used to quote an argument string such that
456 * the shell processes it properly. This is e. g. necessary for
457 * user-provided file names which may contain spaces or quotes.
458 * It also prevents expansion of wild cards and environment variables.
459 */
460 static QString quote( const QString &arg );
461
462 /**
463 * Detaches OProcess from child process. All communication is closed.
464 * No exit notification is emitted any more for the child process.
465 * Deleting the OProcess will no longer kill the child process.
466 * Note that the current process remains the parent process of the
467 * child process.
468 */
469 void detach();
470
471 /**
472 * @return the PID of @a process, or -1 if the process is not running
473 */
474 static int processPID( const QString& process );
475
476signals:
477
478 /**
479 * Emitted after the process has terminated when
480 * the process was run in the @p NotifyOnExit (==default option to
481 * @ref start()) or the @ref Block mode.
482 **/
483 void processExited( Opie::Core::OProcess *proc );
484
485
486 /**
487 * Emitted, when output from the child process has
488 * been received on stdout.
489 *
490 * To actually get
491 * these signals, the respective communication link (stdout/stderr)
492 * has to be turned on in @ref start().
493 *
494 * @param buffer The data received.
495 * @param buflen The number of bytes that are available.
496 *
497 * You should copy the information contained in @p buffer to your private
498 * data structures before returning from this slot.
499 **/
500 void receivedStdout( Opie::Core::OProcess *proc, char *buffer, int buflen );
501
502 /**
503 * Emitted when output from the child process has
504 * been received on stdout.
505 *
506 * To actually get these signals, the respective communications link
507 * (stdout/stderr) has to be turned on in @ref start() and the
508 * @p NoRead flag should have been passed.
509 *
510 * You will need to explicitly call resume() after your call to start()
511 * to begin processing data from the child process's stdout. This is
512 * to ensure that this signal is not emitted when no one is connected
513 * to it, otherwise this signal will not be emitted.
514 *
515 * The data still has to be read from file descriptor @p fd.
516 **/
517 void receivedStdout( int fd, int &len );
518
519
520 /**
521 * Emitted, when output from the child process has
522 * been received on stderr.
523 * To actually get
524 * these signals, the respective communication link (stdout/stderr)
525 * has to be turned on in @ref start().
526 *
527 * @param buffer The data received.
528 * @param buflen The number of bytes that are available.
529 *
530 * You should copy the information contained in @p buffer to your private
531 * data structures before returning from this slot.
532 */
533 void receivedStderr( Opie::Core::OProcess *proc, char *buffer, int buflen );
534
535 /**
536 * Emitted after all the data that has been
537 * specified by a prior call to @ref writeStdin() has actually been
538 * written to the child process.
539 **/
540 void wroteStdin( Opie::Core::OProcess *proc );
541
542protected slots:
543
544 /**
545 * This slot gets activated when data from the child's stdout arrives.
546 * It usually calls "childOutput"
547 */
548 void slotChildOutput( int fdno );
549
550 /**
551 * This slot gets activated when data from the child's stderr arrives.
552 * It usually calls "childError"
553 */
554 void slotChildError( int fdno );
555 /*
556 Slot functions for capturing stdout and stderr of the child
557 */
558
559 /**
560 * Called when another bulk of data can be sent to the child's
561 * stdin. If there is no more data to be sent to stdin currently
562 * available, this function must disable the QSocketNotifier "innot".
563 */
564 void slotSendData( int dummy );
565
566protected:
567
568 /**
569 * Sets up the environment according to the data passed via
570 * setEnvironment(...)
571 */
572 void setupEnvironment();
573
574 /**
575 * The list of the process' command line arguments. The first entry
576 * in this list is the executable itself.
577 */
578 QValueList<QCString> arguments;
579 /**
580 * How to run the process (Block, NotifyOnExit, DontCare). You should
581 * not modify this data member directly from derived classes.
582 */
583 RunMode run_mode;
584 /**
585 * true if the process is currently running. You should not
586 * modify this data member directly from derived classes. For
587 * reading the value of this data member, please use "isRunning()"
588 * since "runs" will probably be made private in later versions
589 * of OProcess.
590 */
591 bool runs;
592
593 /**
594 * The PID of the currently running process (see "getPid()").
595 * You should not modify this data member in derived classes.
596 * Please use "getPid()" instead of directly accessing this
597 * member function since it will probably be made private in
598 * later versions of OProcess.
599 */
600 pid_t pid_;
601
602 /**
603 * The process' exit status as returned by "waitpid". You should not
604 * modify the value of this data member from derived classes. You should
605 * rather use @ref exitStatus than accessing this data member directly
606 * since it will probably be made private in further versions of
607 * OProcess.
608 */
609 int status;
610
611
612 /**
613 * See setRunPrivileged()
614 */
615 bool keepPrivs;
616
617 /*
618 Functions for setting up the sockets for communication.
619 setupCommunication
620 -- is called from "start" before "fork"ing.
621 commSetupDoneP
622 -- completes communication socket setup in the parent
623 commSetupDoneC
624 -- completes communication setup in the child process
625 commClose
626 -- frees all allocated communication resources in the parent
627 after the process has exited
628 */
629
630 /**
631 * This function is called from "OProcess::start" right before a "fork" takes
632 * place. According to
633 * the "comm" parameter this function has to initialize the "in", "out" and
634 * "err" data member of OProcess.
635 *
636 * This function should return 0 if setting the needed communication channels
637 * was successful.
638 *
639 * The default implementation is to create UNIX STREAM sockets for the communication,
640 * but you could overload this function and establish a TCP/IP communication for
641 * network communication, for example.
642 */
643 virtual int setupCommunication( Communication comm );
644
645 /**
646 * Called right after a (successful) fork on the parent side. This function
647 * will usually do some communications cleanup, like closing the reading end
648 * of the "stdin" communication channel.
649 *
650 * Furthermore, it must also create the QSocketNotifiers "innot", "outnot" and
651 * "errnot" and connect their Qt slots to the respective OProcess member functions.
652 *
653 * For a more detailed explanation, it is best to have a look at the default
654 * implementation of "setupCommunication" in kprocess.cpp.
655 */
656 virtual int commSetupDoneP();
657
658 /**
659 * Called right after a (successful) fork, but before an "exec" on the child
660 * process' side. It usually just closes the unused communication ends of
661 * "in", "out" and "err" (like the writing end of the "in" communication
662 * channel.
663 */
664 virtual int commSetupDoneC();
665
666
667 /**
668 * Immediately called after a process has exited. This function normally
669 * calls commClose to close all open communication channels to this
670 * process and emits the "processExited" signal (if the process was
671 * not running in the "DontCare" mode).
672 */
673 virtual void processHasExited( int state );
674
675 /**
676 * Should clean up the communication links to the child after it has
677 * exited. Should be called from "processHasExited".
678 */
679 virtual void commClose();
680
681
682 /**
683 * the socket descriptors for stdin/stdout/stderr.
684 */
685 int out[ 2 ];
686 int in[ 2 ];
687 int err[ 2 ];
688
689 /**
690 * The socket notifiers for the above socket descriptors.
691 */
692 QSocketNotifier *innot;
693 QSocketNotifier *outnot;
694 QSocketNotifier *errnot;
695
696 /**
697 * Lists the communication links that are activated for the child
698 * process. Should not be modified from derived classes.
699 */
700 Communication communication;
701
702 /**
703 * Called by "slotChildOutput" this function copies data arriving from the
704 * child process's stdout to the respective buffer and emits the signal
705 * "@ref receivedStderr".
706 */
707 int childOutput( int fdno );
708
709 /**
710 * Called by "slotChildOutput" this function copies data arriving from the
711 * child process's stdout to the respective buffer and emits the signal
712 * "@ref receivedStderr"
713 */
714 int childError( int fdno );
715
716 // information about the data that has to be sent to the child:
717
718 const char *input_data; // the buffer holding the data
719 int input_sent; // # of bytes already transmitted
720 int input_total; // total length of input_data
721
722 /**
723 * @ref OProcessController is a friend of OProcess because it has to have
724 * access to various data members.
725 */
726 friend class Internal::OProcessController;
727
728private:
729 /**
730 * Searches for a valid shell.
731 * Here is the algorithm used for finding an executable shell:
732 *
733 * @li Try the executable pointed to by the "SHELL" environment
734 * variable with white spaces stripped off
735 *
736 * @li If your process runs with uid != euid or gid != egid, a shell
737 * not listed in /etc/shells will not used.
738 *
739 * @li If no valid shell could be found, "/bin/sh" is used as a last resort.
740 */
741 QCString searchShell();
742
743 /**
744 * Used by @ref searchShell in order to find out whether the shell found
745 * is actually executable at all.
746 */
747 bool isExecutable( const QCString &filename );
748
749 // Disallow assignment and copy-construction
750 OProcess( const OProcess& );
751 OProcess& operator= ( const OProcess& );
752
753private:
754 void init ( );
755 Internal::OProcessPrivate *d;
756};
757}
758}
759
760#endif
761
diff --git a/microkde/words.sort.txt b/microkde/words.sort.txt
deleted file mode 100644
index a477be7..0000000
--- a/microkde/words.sort.txt
+++ b/dev/null
@@ -1,549 +0,0 @@
1
2{ "10 minutes", "10 Minuten", },
3{ "10th", "10." },
4{ "11th", "11." },
5{ "12 pm Format", "12 AM/PM Format" },
6{ "12th", "12." },
7{ "13th", "13." },
8{ "14th", "14." },
9{ "15th", "15." },
10{ "16th", "16." },
11{ "17th", "17." },
12{ "18th", "18." },
13{ "19th", "19." },
14{ "1 Day", "1 Tag" },
15{ "1 h", "1 Std" },
16{ "1 (Highest)", "1 (Höchster)" },
17{ "1st", "1." },
18{ "1st", "2." },
19{ "20th", "20." },
20{ "21st", "21." },
21{ "22nd", "22." },
22{ "23rd", "23." },
23{ "24:00 Hour Format", "24:00 Stunden Format" },
24{ "24th", "24." },
25{ "25th", "25." },
26{ "26th", "26." },
27{ "27th", "27." },
28{ "28th", "28." },
29{ "29th", "29." },
30{ "2nd", "2." },
31{ "30 minutes", "30 Minuten" },
32{ "30th", "30." },
33{ "31st", "31." },
34{ "3rd", "3." },
35{ "4th", "4." },
36{ "5 (lowest)", "5 (Niedrigster)" },
37{ "5th", "5." },
38{ "6th", "6." },
39{ "7th", "7." },
40{ "8th", "8." },
41{ "9th", "9." },
42{ "&Accept", "&Akzeptieren" },
43{ "Accept", "Akzeptieren" },
44{ "Accept A&ll", "A&lles Akzepieren" },
45{ "Access:", "Zugriff:" },
46{ "A corresponding event is missing in your calendar!", "Ein zugehöriges Ereignis fehlt in ihrem Kalender!" },
47{ "Actions", "Aktionen" },
48{ "Add Filter", "Filter Hinzufügen" },
49{ "&Add", "Hinzufügen" },
50{ "Add", "Hinzufügen" },
51{ "Additional email addresses:", "Zusätzliche E-Mail Adressen:" },
52{ "Additional email address:", "Zusätzliche E-Mail Adresse:" },
53{ "&Addressbook", "&Adressbuch" },
54{ "Address &Book...", "Adress&buch..." },
55{ "Agenda Size", "Agende Größe" },
56{ "Agenda Size:", "Größe der Agenda:" },
57{ "Agenda view:", "Agenda Anzeige:" },
58{ "Agenda view background color:", "Hintergrundfarbe der Agenda Anzeige:" },
59{ "All attendees", "Alle Teilnehmer" },
60{ "AllDayAgenda Height:", "Ganztagesagenda Höhe" },
61{ "Allday", "Ganztägig" },
62{ "Anonymous", "Anonym" },
63{ "Apply", "Bestätigen" },
64//{ "Appointment Time ", "" },
65{ "Apr", "Apr" },
66{ "April", "April" },
67//"Ask for every entry on conflict", "",
68{ "Ask for preferences before syncing", "Vor dem Syncronisieren nachfragen" },
69{ "Ask for quit when closing KO/Pi", "Vor dem Beenden von KO/Pi nachfragen" },
70{ "Attendees", "Teilnehmer" },
71{ "Aug", "Aug" },
72{ "August", "August" },
73//"Auto Insert IMIP Replies"),
74//"Auto Insert IMIP Requests"),
75{ "Auto-Save", "Automatisches Abspeichern" },
76{ "Auto save delay in minutes:", "Auto Save Intervall in Minuten" },
77//"Auto Save FreeBusy Replies", ""
78//"Auto Send FreeBusy Information"),
79//"Auto Send Refresh"),
80//"<b>Due on:</b> %1", "",
81//"be added to the standard resource", "",
82//"be asked which resource to use", "",
83{ "Begin on:", "Starte mit:" },
84{ "Begins on: %1", "Starte mit: %1" },
85{ "<b>From:</b> %1 <b>To:</b> %2", "<b>Vom:</b> %1 <b>Zum:</b> %2" },
86{ "Bigger", "Größer" },
87{ "Biggest", "Am größten" },
88{ "Big", "Groß" },
89{ "<b>On:</b> %1", "<b>Am:</b> %1" },
90{ "<b>On:</b> %1 <b>From:S</b> %2 <b>To:</b> %3", "<b>Am:</b> %1 <b>Vom:S</b> %2 <b>Zum:</b> %3" },
91{ "<b>Original event:</b><p>", "<b>Original Ereignis:</b><p>" },
92{ " - both are modified after last sync", " - beide wurden nach der letzten Syncronisation verändert" },
93{ "Busy", "Belegt" },
94{ "&Cancel", "Abbre&chen" },
95{ "Cancel", "Abbrechen" },
96{ "Cannot delete To-Do\nwhich has children.", "Kann Todo nicht löschen,\n da noch Einträge vorhanden sind" },
97{ "Cannot delete To-Do which has children.", "Kann Todo nicht löschen, da noch Einträge vorhanden sind" },
98//"Cannot move To-Do to itself or a child of itself"),
99//"Cannot purge To-Do which\nhas uncompleted children."
100//"Can't generate mail:\nNo attendees defined.\n"));
101{ "Can't generate mail:\nNo event selected.", "Kann e-Mail nicht erstellen:\nKein Ereignis ausgewählt." },
102{ "Categories...", "Kategorien..." },
103{ "Categories", "Kategorien" },
104{ "Category", "Kategorie" },
105{ "Center View", "Mittenansicht" },
106{ "Change", "Verändere" },
107{ "Cinema", "Kino" },
108{ "Click to add a new Todo", "Klicken, um ein neues Todo anzulegen" },
109{ "Clone Item", "Klone Eintrag" },
110{ "&Close", "S&chließen" },
111{ "Close", "Schließen" },
112{ "Close this dialog to abort deletion!", "Zum Abbrechen des Löschvorganges Dialog schließen!" },
113{ "Colors", "Farben" },
114{ "completed", "fertiggestellt" },
115{ "completed on %1", "fertiggestellt um %1" },
116{ "Complete", "Fertigstellen" },
117//{ "concatenation of dates and time", "%1 %2" },
118{ "Confirm &deletes", "Löschvogang bestätigen" },
119//"Copying succeed. Syncing not yet implemented"
120//"Copy remote file to local machine..."
121//{ "Could not find your attendee entry.\nPlease check the emails.")) },
122{ "Couldn't load calendar\n '%1'.", "Kann Kalender\n '%1' nicht laden." },
123{ "Counter-event Viewer", "Ereigniszähler Anzeige" },
124//{ "counter proposal event","<b>Counter-event:</b><p>" },
125{ "Daily ending hour:", "Tägl. Schlusszeit:" },
126{ "Daily starting hour:", "Tägliche Anfangszeit:" },
127{ "Daily", "Täglich" },
128{ "Date Format", "Datum Format" },
129{ "DateNavigator:(nr)" , "Datums Navigator" },
130//{ "Date Range") },
131{ "Dates: ", "Datum: " },
132{ "Date && Time", "Datum && Zeit" },
133{ "Day begins at:", "Der Tag beginnt um:" },
134{ "Days in Next-X-Days:", "Tage in den Nächsten-X-Tagen:" },
135{ "Days in What's Next:", "Tage in Was-kommt-Nun:" },
136{ "day(s)", "Tag(e)" },
137{ "Days to show in Next-X-Days view:", "Welche Tage in Nächste-X-Tagen anzeigen:" },
138{ "day", "Tag" },
139{ "Dec", "Dez" },
140{ "December", "Dezember" },
141{ "Default alarm time:", "Standard Alarm Zeit:" },
142//{ "Default appointment time:") },
143//{ "Default Calendar Format") },
144//{ "Default event color:") },
145//{ "Default export file", "calendar.html")) },
146{ "Default", "Standard" },
147//{ "Def. duration of new app.:") },
148{ "Delete All", "Lösche alles" },
149{ "Delete all selected", "Lösche alle ausgewählten" },
150//{ "delete completed To-Dos","Purge Completed") },
151//{ "delete completed To-Dos","Purge Completed") },
152{ "Delete Current", "Aktuellen löschen" },
153{ "Delete Event...", "Lösche Ereignis..." },
154{ "Delete Event", "Lösche Ereignis" },
155{ "&Delete", "Löschen" },
156{ "Delete", "Löschen" },
157{ "Delete Todo...", "Lösche Todo..." },
158{ "Delete To-Do", "Lösche Todo" },
159{ "Deleting item %d ...", "Lösche Eintrag %d..." },
160{ "Descriptions", "Beschreibungen" },
161{ "Deselect All", "Alles deselektieren" },
162{ "Details", "Details" },
163{ "Dinner", "Abendessen" },
164//{ "%d item(s) found."), mMatchedEvents.count() ) },
165//{ "%d items remaining in list."), count() ) },
166{ "Do you really want\nto close KO/Pi?", "Möchten Sie wirklich\nKO/PI verlassen?" },
167//"Do you really want\nto remote sync?\n \n"
168//{ "Drop Event },
169//{ "Drop To-Do")) },
170//{ "Due Date")) },
171//{ "Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueTimeStr() },
172//{ "Due Time")) },
173//{ "Due:"),timeBoxFrame) },
174{ "Duration: ", "Dauer: " },
175{ "Edit...", "Bearbeite..." },
176{ "Edit", "Bearbeite" },
177//{ "Edit Calendar Filters },
178{ "Edit Event...", "Bearbeite Ereignis..." },
179{ "Edit Event", "Bearbeite Ereignis" },
180//{ "Edit exceptions"), Ok|Cancel },
181{ "EditorBox:", "Editor Fenster:" },
182{ "Edit Recurrence Range", "Bearbeite Wiederholung" },
183//{ "&Edit..."),this,SLOT(popupEdit()))) },
184{ "Edit Todo...", "Berabeite Todo..." },
185{ "Edit To-Do", "Todo bearbeiten" },
186//{ "Email:" ) ) },
187{ "E&mail address:", "E&mail Adresse" },
188{ "(EmptyEmail)" , "(KeineEmail)" },
189{ "(EmptyName)", "(KeinName)" },
190//{ "Enable automatic saving of calendar") },
191//{ "Enable group scheduling") },
192//{ "Enable project view") },
193//{ "Enable Recurrence"), this ) },
194//{ "Enable scrollbars in month view cells") },
195//{ "Enable tooltips displaying summary of ev.") },
196//{ "End after"), rangeBox ) },
197//{ "End by:"), rangeBox ) },
198//{ "End Date")) },
199{ "End:", "Ende:" },
200//{ "End Time", "E)) },
201{ "English", "Englisch" },
202//{ "Enter filter name: },
203//{ "Error", "Fehler" },
204//{ "Error loading template file '%1'." },
205//{ "Event already exists in this calendar.") },
206{ "Event", "Ereignis" },
207{ "Event list", "Ereignis Liste" },
208//{ "Event list view uses full window") },
209//{ "Events and To-Dos that need a reply:") + "</h2>\n" },
210//{ "Events: ") + "</h2>\n" },
211//{ "Events have to be completely included"), topFrame) },
212//{ "Events"),incidenceGroup) },
213{ "Event Viewer:", "Ereignis Anzeige" },
214//{ "Event Viewer"),Ok|User1,Ok,false },
215//{ "Event will be sent to:")+"</h4>" },
216//{ "every"), this ) },
217{ "Exceptions...", "Ausnahmen..." },
218{ "Exceptions", "Ausnahmen" },
219{ "Exclude holidays", "Ohne Ferien" },
220{ "Exclude Saturdays", "Ohne Samstage" },
221//{ "Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave) },
222{ "Feb", "Feb" },
223{ "February", "Februar" },
224//{ "Filter disabled },
225//{ "Filter position: ") + QString::number ( mSelectionCombo->currentItem()+1 )) },
226//{ "Filter selected: },
227{ "&Find", "Finden" },
228{ "Fonts", "Zeichensätze" },
229//{ "Force take local entry always")) },
230//{ "Force take remote entry always")) },
231//{ "Form1" ) ) },
232//{ "Free Busy Object")) },
233{ "Free", "Frei" },
234{ "Friday", "Freitag" },
235{ "Fri", "Fr" },
236//{ "From: %1 To: %2 %3").arg(from).arg(to },
237//{ "From:"),rangeWidget)) },
238{ "Full &name:", "Vor- und &Nachname:" },
239//{ "Full path and file name required!"), topFrame) },
240{ "General", "Allgemein" },
241{ "German", "Deutsch" },
242{ "Gifts", "Geschenke" },
243//{ "Group Automation"),0 },
244//{ "Group Scheduling"),0 },
245{ "Help", "Hilfe" },
246{ "Hide Dates", "Daten ausblenden" },
247{ "Highlight color:" "Hervorhebungsfarbe" },
248{ "Holiday color:", "Ferien Farbe" },
249{ "hour(s)", "Stunde(n)" },
250//{ "iCalendar")) },
251//{ "If attendee is in addressbook")) },
252//{ "If organizer is in addressbook")) },
253//{ "If requested from an email in addressbook")) },
254//{ "If this counter-event is a good proposal for your event, press 'Accept'. All Attendees will then get the new version of this event },
255//{ "In %1 days: ").arg( i ) + "</font></em>"+day },
256//{ "Incomplete Todo:") + "</strong></big></big>\n" },
257{ "Information", "Information" },
258{ "Invalid search expression,\ncannot perform ", "Kann Suche nicht ausführen" },
259{ "Jan", "Jan" },
260{ "January", "Januar" },
261{ "JournalView:", "Journal Ansicht" },
262{ "Jul", "Jul" },
263{ "July", "Juli" },
264{ "Jump to date", "Springe zum Datum" },
265{ "June", "Juni" },
266{ "Jun", "Jun" },
267{ "Kids", "Kinder" },
268//{ "KMail", "KMail" },
269{ "KO/E Find ", "KO/E Suchen " },
270{ "KO/E Find: ", "KO/E Suchen: " },
271{ "KO/Pi is starting ... ", "KO/Pi startet ..." },
272{ "Language:(nyi)", "Sprache" },
273{ "Language:", "Sprache" },
274{ "Large", "Etwas mehr" },
275{ "List View:", "Listenansicht" },
276{ "Load/Save", "Laden/Speichern" },
277{ "Load Template", "Lade Vorlage" },
278{ "Locale", "Spracheinstellung" },
279{ "Local temp file:", "Lokales temp. Datei:" },
280//"Local temp file:\n "
281//"Local temp file:\n..."
282{ "Location: ", "Ort: " },
283{ "Location:", "Ort:" },
284{ "Mail client", "Mail Programm" },
285{ "Mail Client", "Mail Programm" },
286{ "March", "März" },
287{ "Mar", "Mär" },
288{ "May", "Mai" },
289{ "M. Bains line:", "M. Bains Linie:" },
290{ "Medium", "Medium" },
291{ "Method", "Methode" },
292{ "minute(s)", "Minute(n)" },
293{ "Monday", "Montag" },
294{ "Mon", "Mo" },
295{ "Monthly", "Monatlich" },
296{ "Month not long enough", "Monat ist nicht lang genug" },
297{ "month(s)", "Monat(e)" },
298{ "Month view:", "Monatsansicht" },
299{ "Month view uses category colors", "Monatsansicht benutzt die Kategorie Farben" },
300{ "Move &Down", "Nach unten verschieben" },
301{ "Move &Up", "Nach oben verschieben" },
302{ "Name:", "Name:" },
303{ "Name", "Name" },
304{ "\nAre you sure you want\nto delete this event?", "Sind Sie sicher, dass\n sie das Ereignis löschen möchten?" },
305{ "%n Days", "%n Tage" },
306{ "Never", "Nie" },
307{ "New event...", "Neues Ereignis..." },
308{ "New event", "Neues Ereignis" },
309{ "New Events/Todos should", "Meue Ereignisse/Todos sollten" },
310{ "&New", "&Neu" },
311{ "New", "Neu", },
312{ "New Sub-Todo...", "Neues Sub-Todo..." },
313{ "New Todo...", "Neues Todo..." },
314{ "New Todo", "Neues Todo" },
315{ "Next Alarm: ", "Nächster Alarm: ", },
316{ "&Next Day", "&Nächster Tag", },
317{ "Next days view uses full window", "Die Ansicht des nächsten Tages maximieren" },
318{ "Next month", "Nächster Monat" },
319{ "&Next Week", "&Nächste Woche" },
320{ "Next year", "Nächstes Jahr" },
321{ "Next Year", "Nächstes Jahr" },
322{ "%n h", "%n Std" },
323//"\n \nTry command on console to get more\ndetailed info about the reason.\n"
324//{ "nobody@nowhere", " },
325{ "No ending date", "Kein End-Datum", },
326{ "No event, nothing to do.", "Kein Ereignis, nichts zu tun.", },
327{ "No event selected.", "Kein Ereignis selektiert" },
328//{ "No event/todo were found matching\nyour search expression.\nUse the wildcard characters\n ' * ' and ' ? ' where needed."));"KO/E Find ")) },
329{ "No", "Nein" },
330{ "No program set", "Kein Programm ausgewählt", },
331{ "Normal", "Normal" },
332{ "[No selection]", "Keine Selektion", },
333{ "No sound set", "Kein Sound ausgewählt", },
334{ "no time ", "keine Zeit ", },
335{ "no time", "keine Zeit", },
336{ "No Time", "Keine Zeit" },
337{ "November", "November" },
338{ "Nov", "Nov", },
339{ "\nThis event recurs\nover multiple dates.\n", "\nDieses Ereignis wiederholt sich an mehreren Tagen.\n" },
340//{ "occurrence(s)"), rangeBox ) },
341{ "October", "Oktober" },
342{ "Oct", "Okt", },
343//{ "O-due!", " },
344//{ "Okay, another question:\n\nDo you really want\nto erase your complete disk?\nI hope, the decision is now\na little bit easier! },
345{ "&OK", "&OK" },
346{ "Ok+Show!", "Ok+Anzeigen" },
347{ "Organizer: %1","Organizer %1" },
348{ "Organizer","Organizer" },
349//{ "Overdue To-Do:") + "</h2>\n" },
350{ "Owner: ", "Besitzer: " },
351{ "Owner:", "Besitzer:" },
352{ "<p><b>Priority:</b> %2</p>", "<p><b>Priorität:</b> %2</p>" },
353//{ "Personal Travel", },
354//{ "<p><i>%1 % completed</i></p>" },
355{ "Pick a date to display", "Wähle einen Tag zum anzeigen aus" },
356//{ "Playing '%1'").arg(fileName) },
357//{ "Playing '%1'").arg(mAlarmSound) },
358//{ "Please specify a valid due date.")) },
359//{ "Please specify a valid end date, for example '%1'." },
360//{ "Please specify a valid start date.")) },
361//{ "Please specify a valid start date, for example '%1'." },
362//{ "Please specify a valid start time.")) },
363//{ "Please specify a valid start time, for example '%1'." },
364//{ "Preferences - some settings need a restart (nr)")) },
365{ "Preferences - some settings need a restart (nr)", "Einstellungen - teilweise Neustart erforderlich" },
366{ "&Previous Day", "Vorheriger Tag" },
367{ "Previous month", "Vorheriger Monat" },
368{ "Previous Month", "Vorheriger Monat" },
369{ "&Previous Week", "Vorherige Woche" },
370{ "Previous year", "Vorheriges Jahr" },
371{ "Previous Year", "Vorheriges Jahr" },
372{ "Printing", "Drucken" },
373//{ "Prio")) },
374//{ "Priority:"), h) },
375{ "Proceed", "Weiter" },
376//{ "Purge },
377//{ "read-only") + ")</em>") },
378{ "Recur every", "Wiederh. alle" },
379{ "Recur in the month of", "Wiederh. im Monat" },
380{ "Recur on the", "Wiederh. am" },
381{ "Recur on this day", "Wiederh. am diesen Tag" },
382{ "Recurrence Range...", "Wiederholungs Zeitraum..." },
383{ "Recurrence Range", "Wiederholungs Zeitraum" },
384{ "Recurrence Rule", "Wiederholungs Regel" },
385{ "Recurrence", "Wiederholung" },
386{ "Recurs", "Wiederhole" },
387"&Reject", "Abweisen",
388{ "Reminder:", "Erinnerung:" },
389//"Remote file:\n "
390//"Remote file:\n..."
391//{ "Remote file:"), topFrame) },
392//{ "Remote IP:"), topFrame) },
393//{ "Remote passwd:"), topFrame) },
394//{ "Remote syncing (via ssh/scp) network settings "), topFrame) },
395//{ "Remote user:"), topFrame) },
396{ "&Remove", "Entfe&rnen" },
397{ "Remove", "Entfernen" },
398{ "Request response", "Bemerkung anfordern" },
399//{ "Retrieve &Messages" ) ) },
400{ "Role:", "Rolle:" },
401{ "Role", "Rolle" },
402//{ "RSVP"),35) },
403//{ "Running '%1'").arg(fileName) },
404//{ "Running '%1'").arg(mAlarmProgram) },
405{ "Sat", "Sa" },
406{ "Saturday", "Samstag" },
407//{ "Save Template"), Ok | Cancel, Ok, parent, 0 },
408//{ "Scheduler - Incoming Messages" ) ) },
409//{ "Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler) },
410//{ "Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend) },
411//{ "Scheduler - Outgoing Messages" ) ) },
412{ "Search for:", "Suche nach:" },
413{ "Search In", "Suche in" },
414{ "Search", "Suche" },
415{ "Select Addresses", "Wähle Adressen" },
416{ "Select all", "Wähle alles" },
417{ "Select a month", "Wähle Monat" },
418//{ "Select a template to load:"), templates, 0, &ok ) },
419{ "Select a week", "Wähle Woche" },
420{ "Select a year", "Wähle Jahr" },
421//{ "selected emails")) },
422//{ "Select Template Name"), topFrame },
423//{ "Select the current day")) },
424//{ "Send copy to owner when mailing events") },
425{ "Send directly", "Sende direkt" },
426//{ "Sendmail")) },
427{ "&Send Messages", "&Sende Nachrichten", },
428//{ "Send to outbox")) },
429{ "Sep", "Sep" },
430{ "September", "September" },
431//{ "Set your status },
432//{ "Set Your Status")) },
433{ "Shopping", "Einkaufen" },
434{ "Short date in (WN/E) view", "Kurzdatum in (WN/E) Anzeige" },
435{ "Show Dates", "Zeige Daten" },
436//{ "Show events that recur daily in date nav.") },
437{ "Show Event...", "Zeige Ereignis..." },
438//{ "Show ev. that recur weekly in date nav.") },
439//{ "Show Marcus Bains line") },
440//{ "Show seconds on Marcus Bains line") },
441//{ "Show summary after syncing") },
442{ "Show time as:", "Zeige Zeit als" },
443{ "Show Todo...", "Zeige To-Do" },
444//{ "Show topmost todo prios in What's N.:") },
445//{ "Show topmost todo prios in What's Next:") },
446//{ "Show vertical screen (Needs restart)") },
447{ "&Show", "Zeige" },
448{ "Show...", "Zeige..." },
449{ "Show", "Zeige" },
450{ "Small", "Klein" },
451{ "Sorry", "Entschuldigung" },
452//"Sorry, the copy command failed!\nCommand was:\n"
453//{ "Sort Id")) },
454{ "Start:", "Anfang:" },
455{ "Start Date", "Start Datum" },
456{ "Start Time", "Start Zeit" },
457{ "Status:", "Status:" },
458{ "Status","Status:" },
459//{ "Stretched TB", "
460{ "Summaries","Zusammenfassungen" },
461{ "Summary:","Zusammenfassung:" },
462{ "Summary","Zusammenfassung" },
463{ "Sunday", "Sonntag" },
464{ "Sun", "So" },
465//{ "Sync Network"),0,0) },
466{ "Sync preferences:", "Sync Einstellungen" },
467{ "Sync Prefs", "Sync Einstellungen" },
468{ "Syncronize", "Daten abgleich" },
469//{ "Take local entry on conflict")) },
470//{ "Take newest entry on conflict")) },
471//{ "Take remote entry on conflict")) },
472//{ "Template '%1' does not contain a valid Todo." },
473//{ "Template does not contain a valid Event." },
474{ "Template...", "Vorlage..." },
475//{ "The event ends before it starts.\n },
476//{ "The event has no attendees.")) },
477//{ "The journal entries can not be\nexported to a vCalendar file.") },
478//{ "The organizer %1", " },
479//{ "The start date cannot be after the due date.")) },
480//{ " - they have the same unique ID "), topFrame) },
481{ "This day", "Dieser Tag" },
482{ "This is an experimental feature. ", "Dieses Feature ist experimentel" },
483//{ "This is a recurring event.") + "</em>") },
484{ "This item will be\npermanently deleted.", "Dieser Eintrag wird\nkomplett gelöscht." },
485{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." },
486{ "Thu", "Do" },
487{ "Thursday", "Donnerstag" },
488{ "Time associated", "Dazugehörige Zeit" },
489{ "Time bar:", "Zeit Intervall" },
490{ "Time && Date", "Zeit und Datum" },
491{ "Time Format", "Zeit Format" },
492{ "Time Labels:", "Zeit Markierungen:" },
493{ "Time: ", "Zeit: " },
494{ "Timezone:", "Zeitzone:" },
495{ "Tiny", "Sehr klein" },
496{ "To: ", "An: " },
497{ "To:", "An:" },
498{ "Today: ", "Heute: " },
499//{ "To-Do: %1 },
500//{ "Todo due today color:") },
501//{ "To-do items:"),this) },
502//{ "Todo overdue color:") },
503//{ "Todos"),incidenceGroup) },
504{ "Todo", "Todo" },
505{ "To-do view shows completed Todos", "To-do Anzeige zeigt erledigte To-dos" },
506{ "ToDoView:", "Todo Anzeige:" },
507{ "Toggle Alarm", "Wechsle Alarm" },
508{ "Toggle Allday", "Umschalten Ganztag" },
509//{ "toggle completed To-Dos","Hide/Show Completed") },
510//{ "toggle completed To-Dos","Hide/Show Completed") },
511{ "Tomorrow: ", "Morgen: " },
512// { "Toolbar", "Zugriffsleiste" },
513{ "Tue", "Di" },
514{ "Tuesday", "Dienstag" },
515{ "Two entries are in conflict, if: ", "Zwei Einträge haben einen Konflikt, wenn:" },
516{ "Unable to find template '%1'.", "Kann Vorlage '%1' nicht finden." },
517{ "University", "Universität" },
518{ "Unknown", "Unbekannt" },
519{ "Up", "Hinauf" },
520//{ "&Use email settings from Control Center", " },
521{ "Use password (if not, ask when syncing)", "Passwort: (sonst jedesmal anfragen)" },
522{ "User defined (next page)", "Benutzer definiert (Nächste Seite)" },
523{ "User long date", "Benutz. lang. Datum" },
524{ "User short date", "Benutz. kurz. Datum" },
525//{ "vCalendar")) },
526{ "View", "Ansicht" },
527{ "View", "Anzeige" },
528{ "View Fonts", "Zeige Schriften" },
529{ "Views", "Ansichten" },
530//{ "VIP") },
531{ "Wed", "Mi" },
532{ "Wednesday", "Mittwoch" },
533{ "Week %1", "Woche %1" },
534{ "Weekly", "Wöchentlich" },
535//{ "week(s) on:"), this ) },
536{ "Week starts on Sunday", "Wochenanfang Sonntags" },
537{ "What's Next View:", "What's Next Anzeige" },
538{ "What's next ?", "Was kommt als nächstes?" },
539{ "Working Hours", "Arbeitsstunden" },
540{ "Working hours color:", "Farbe der Arbeitsstunden" },
541{ "Write back existing entries only", "Nur exisitierende Einträge zurückschreiben" },
542{ "Write back synced file", "Syncronisierte Datei zurückschreiben" },
543{ "Yearly", "Jährlich" },
544{ "year(s)", "Jahr(e)" },
545{ "Yes", "Ja" },
546{ "You have %d item(s) selected.\n", "Sie haben %d Einträge ausgewählt.\n" },
547{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." },
548//{ "Zoom In", "Hineinzoomen" },
549//{ "Zoom Out", "Herauszoomen" },