20 #include "korghelper.h"
22 #include <dcopclient.h>
24 #include <tdeapplication.h>
26 #include <kdcopservicestarter.h>
28 void KMail::KorgHelper::ensureRunning()
31 TQCString dcopService;
32 int result = KDCOPServiceStarter::self()->findServiceFor( "DCOP/Organizer", TQString(), TQString(), &error, &dcopService );
36 static const char* const dcopObjectId = "KOrganizerIface";
38 if ( !kapp->dcopClient()->findObject( dcopService, dcopObjectId, "", TQByteArray(), dummy, dummy ) ) {
39 DCOPRef ref( dcopService, dcopService );
40 DCOPReply reply = ref.call( "load()" );
41 if ( reply.isValid() && ( bool)reply ) {
42 kdDebug() << "Loaded " << dcopService << " successfully" << endl;
43 Q_ASSERT( kapp->dcopClient()->findObject( dcopService, dcopObjectId, "", TQByteArray(), dummy, dummy ) );
45 kdWarning() << "Error loading " << dcopService << endl;
52 kdWarning() << "Couldn't start DCOP/Organizer: " << dcopService << " " << error << endl;
|