alarmclient.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "alarmclient.h"
00023
00024 #include <kprocess.h>
00025 #include <dcopclient.h>
00026 #include <kapplication.h>
00027 #include <kdebug.h>
00028
00029 AlarmClient::AlarmClient( QObject *o, const char *name )
00030 : QObject( o, name )
00031 {
00032 kdDebug() << "AlarmClient::AlarmClient()" << endl;
00033 }
00034
00035 void AlarmClient::startDaemon()
00036 {
00037 if ( kapp->dcopClient()->isApplicationRegistered( "korgac" ) ) {
00038
00039 return;
00040 }
00041
00042 KProcess *proc = new KProcess;
00043 *proc << "korgac";
00044 *proc << "--miniicon" << "korganizer";
00045 connect( proc, SIGNAL( processExited( KProcess * ) ),
00046 SLOT( startCompleted( KProcess * ) ) );
00047 if ( !proc->start() ) delete proc;
00048 }
00049
00050 void AlarmClient::startCompleted( KProcess *process )
00051 {
00052 delete process;
00053 }
00054
00055 void AlarmClient::stopDaemon()
00056 {
00057 kapp->dcopClient()->send( "korgac", "ac", "quit()", QByteArray() );
00058 }
00059
00060 #include "alarmclient.moc"
This file is part of the documentation for korganizer Library Version 3.2.2.