summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.cpp
Unidiff
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp37
1 files changed, 34 insertions, 3 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 07bdff2..779b20e 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -35,67 +35,71 @@ $Id$
35 35
36#ifndef DESKTOP_VERSION 36#ifndef DESKTOP_VERSION
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#include <qtopia/qcopenvelope_qws.h> 38#include <qtopia/qcopenvelope_qws.h>
39#else 39#else
40#include <qapplication.h> 40#include <qapplication.h>
41#endif 41#endif
42 42
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <kmessagebox.h> 44#include <kmessagebox.h>
45 45
46 46
47#include "externalapphandler.h" 47#include "externalapphandler.h"
48 48
49#include "kpimglobalprefs.h" 49#include "kpimglobalprefs.h"
50 50
51//uncomment line to get debug output
52//#define DEBUG_EXT_APP_HANDLER
53
51/********************************************************************************* 54/*********************************************************************************
52 * 55 *
53 ********************************************************************************/ 56 ********************************************************************************/
54 57
55 58
56QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 59QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
57 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) 60 : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage)
58{ 61{
59 //sourceMessage passes later three parameters: sourceChannel, uid, param1 62 //sourceMessage passes later three parameters: sourceChannel, uid, param1
60 if (_usedSourceParameters == 0) 63 if (_usedSourceParameters == 0)
61 _sourceMessageParameters = "(QString,QString)"; 64 _sourceMessageParameters = "(QString,QString)";
62 else if (_usedSourceParameters == 1) 65 else if (_usedSourceParameters == 1)
63 _sourceMessageParameters = "(QString,QString,QString)"; 66 _sourceMessageParameters = "(QString,QString,QString)";
64 else if (_usedSourceParameters == 2) 67 else if (_usedSourceParameters == 2)
65 _sourceMessageParameters = "(QString,QString,QString,QString)"; 68 _sourceMessageParameters = "(QString,QString,QString,QString)";
66 else if (_usedSourceParameters == 3) 69 else if (_usedSourceParameters == 3)
67 _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; 70 _sourceMessageParameters = "(QString,QString,QString,QString,QString)";
68} 71}
69 72
70/*********************************************************************************/ 73/*********************************************************************************/
71 74
72QCopTransferItem::QCopTransferItem() 75QCopTransferItem::QCopTransferItem()
73{ 76{
74} 77}
75 78
76/*********************************************************************************/ 79/*********************************************************************************/
77bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) 80bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3)
78{ 81{
79 82
80#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
81 //sourceMessage passes two parameters: sourceChannel, uid 84 //sourceMessage passes two parameters: sourceChannel, uid
82 QString sourceMessage = _sourceMessage + _sourceMessageParameters; 85 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
83 86#ifdef DEBUG_EXT_APP_HANDLER
84 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 87 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1());
85 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); 88 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1());
89#endif
86 90
87 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 91 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
88 92
89 e << _sourceChannel << uid; 93 e << _sourceChannel << uid;
90 94
91 if (_usedSourceParameters == 1) 95 if (_usedSourceParameters == 1)
92 e << param1; 96 e << param1;
93 else if (_usedSourceParameters == 2) 97 else if (_usedSourceParameters == 2)
94 e << param1 << param2; 98 e << param1 << param2;
95 else if (_usedSourceParameters == 3) 99 else if (_usedSourceParameters == 3)
96 e << param1 << param2 << param3; 100 e << param1 << param2 << param3;
97 101
98 qApp->processEvents(); 102 qApp->processEvents();
99 103
100 return true; 104 return true;
101 105
@@ -184,34 +188,36 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data
184 188
185 189
186QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 190QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
187 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 191 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
188{ 192{
189 //targetMessage returns later two parameters: uid, and map<qstring,qstring> 193 //targetMessage returns later two parameters: uid, and map<qstring,qstring>
190 _targetMessageParameters = "(QString,QMAP<QString,QString>)"; 194 _targetMessageParameters = "(QString,QMAP<QString,QString>)";
191} 195}
192 196
193/*********************************************************************************/ 197/*********************************************************************************/
194bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap) 198bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
195{ 199{
196#ifndef DESKTOP_VERSION 200#ifndef DESKTOP_VERSION
197 //targetMessage passes two parameters: uid, map 201 //targetMessage passes two parameters: uid, map
198 QString targetMessage = _targetMessage + _targetMessageParameters; 202 QString targetMessage = _targetMessage + _targetMessageParameters;
199 203
204#ifdef DEBUG_EXT_APP_HANDLER
200 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 205 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
201 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1()); 206 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1());
207#endif
202 208
203 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 209 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
204 //US we need no names in the To field. The emailadresses are enough 210 //US we need no names in the To field. The emailadresses are enough
205 211
206 e << uid << nameEmailMap; 212 e << uid << nameEmailMap;
207 213
208 qApp->processEvents(); 214 qApp->processEvents();
209 215
210 return true; 216 return true;
211 217
212#else 218#else
213 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 219 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
214 return false; 220 return false;
215#endif 221#endif
216 222
217} 223}
@@ -253,80 +259,88 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da
253 259
254 260
255QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 261QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
256 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 262 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
257{ 263{
258 //targetMessage returns later two parameters: uid, and three lists 264 //targetMessage returns later two parameters: uid, and three lists
259 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)"; 265 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)";
260} 266}
261 267
262/*********************************************************************************/ 268/*********************************************************************************/
263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) 269bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6)
264{ 270{
265#ifndef DESKTOP_VERSION 271#ifndef DESKTOP_VERSION
266 //targetMessage passes two parameters: uid, map 272 //targetMessage passes two parameters: uid, map
267 QString targetMessage = _targetMessage + _targetMessageParameters; 273 QString targetMessage = _targetMessage + _targetMessageParameters;
268 274
275#ifdef DEBUG_EXT_APP_HANDLER
269 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 276 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
270 qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1()); 277 qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1());
271 278
272 279
273 for ( int i = 0; i < list3.count(); i++) 280 for ( int i = 0; i < list3.count(); i++)
274 qDebug("listentry list3: %s",list3[i].latin1()); 281 qDebug("listentry list3: %s",list3[i].latin1());
282#endif
275 283
276 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 284 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
277 //US we need no names in the To field. The emailadresses are enough 285 //US we need no names in the To field. The emailadresses are enough
278 286
279 e << uid << list1 << list2 << list3 << list4 << list5 << list6; 287 e << uid << list1 << list2 << list3 << list4 << list5 << list6;
280 288
281 qApp->processEvents(); 289 qApp->processEvents();
282 290
283 return true; 291 return true;
284 292
285#else 293#else
286 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 294 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
287 return false; 295 return false;
288#endif 296#endif
289 297
290} 298}
291 299
292 300
293/*********************************************************************************/ 301/*********************************************************************************/
294bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 302bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
295{ 303{
296 bool res = QCopTransferItem::appMessage( cmsg, data ); 304 bool res = QCopTransferItem::appMessage( cmsg, data );
305#ifdef DEBUG_EXT_APP_HANDLER
297 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 306 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
307#endif
298 308
299 if (res == false) 309 if (res == false)
300 { 310 {
301 QDataStream stream( data, IO_ReadOnly ); 311 QDataStream stream( data, IO_ReadOnly );
302 312
313#ifdef DEBUG_EXT_APP_HANDLER
303 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 314 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
315#endif
304 316
305 //we are in the source and get an answer from the target 317 //we are in the source and get an answer from the target
306 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 318 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
307 { 319 {
308 QStringList list1; 320 QStringList list1;
309 QStringList list2; 321 QStringList list2;
310 QStringList list3; 322 QStringList list3;
311 QStringList list4; 323 QStringList list4;
312 QStringList list5; 324 QStringList list5;
313 QStringList list6; 325 QStringList list6;
314 QString uid; 326 QString uid;
315 327
328#ifdef DEBUG_EXT_APP_HANDLER
316 qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 329 qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
330#endif
317 331
318 stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6; 332 stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6;
319 emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6); 333 emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6);
320 334
321 335
322 return true; 336 return true;
323 } 337 }
324 } 338 }
325 339
326 return false; 340 return false;
327} 341}
328 342
329 343
330 344
331/********************************************************************************* 345/*********************************************************************************
332 * 346 *
@@ -423,34 +437,37 @@ void ExternalAppHandler::loadConfig()
423 ( QFile::exists( opiepath + "/bin/kppi" ))) 437 ( QFile::exists( opiepath + "/bin/kppi" )))
424 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); 438 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
425 439
426 //faxclients 440 //faxclients
427 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); 441 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined);
428 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); 442 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined);
429 443
430 //smsclients 444 //smsclients
431 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined); 445 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined);
432 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined); 446 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined);
433 447
434 //pagerclients 448 //pagerclients
435 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined); 449 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined);
436 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined); 450 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined);
437 451
438 //sipclients 452 //sipclients
439 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC, "No sip client installed", undefined, undefined, undefined, undefined, undefined); 453 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC, "No SIP client installed", undefined, undefined, undefined, undefined, undefined);
440 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::OTHER_SIC, "Other sip client", undefined, undefined, undefined, undefined, undefined); 454 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::OTHER_SIC, "Other SIP client", undefined, undefined, undefined, undefined, undefined);
455 if (( QFile::exists( qtopiapath + "/bin/kppi" )) ||
456 ( QFile::exists( opiepath + "/bin/kppi" )))
457 addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::KPPI_SIC, "KP/Pi SIP client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
441 458
442} 459}
443 460
444ExternalAppHandler *ExternalAppHandler::instance() 461ExternalAppHandler *ExternalAppHandler::instance()
445{ 462{
446 if ( !sInstance ) { 463 if ( !sInstance ) {
447 sInstance = staticDeleter.setObject( new ExternalAppHandler() ); 464 sInstance = staticDeleter.setObject( new ExternalAppHandler() );
448 sInstance->loadConfig(); 465 sInstance->loadConfig();
449 } 466 }
450 467
451 return sInstance; 468 return sInstance;
452} 469}
453 470
454void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) 471void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2)
455{ 472{
456 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); 473 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2);
@@ -622,34 +639,36 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS
622 { 639 {
623 DefaultAppItem* dai = getDefaultItem(EMAIL, client); 640 DefaultAppItem* dai = getDefaultItem(EMAIL, client);
624 if (!dai) 641 if (!dai)
625 { 642 {
626 qDebug("could not find configured email application."); 643 qDebug("could not find configured email application.");
627 return false; 644 return false;
628 } 645 }
629 channel = dai->_channel; 646 channel = dai->_channel;
630 message2 = dai->_message2; 647 message2 = dai->_message2;
631 parameters2 = dai->_parameters2; 648 parameters2 = dai->_parameters2;
632 } 649 }
633 650
634 //first check if one of the mailers need the emails right in the message. 651 //first check if one of the mailers need the emails right in the message.
635 message2 = translateMessage(message2, emails, urls); 652 message2 = translateMessage(message2, emails, urls);
636 653
637 654
655#ifdef DEBUG_EXT_APP_HANDLER
638 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); 656 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1());
639 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); 657 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1());
658#endif
640 659
641 660
642 QCopEnvelope e(channel.latin1(), message2.latin1()); 661 QCopEnvelope e(channel.latin1(), message2.latin1());
643 //US we need no names in the To field. The emailadresses are enough 662 //US we need no names in the To field. The emailadresses are enough
644 663
645 passParameters(&e, parameters2, emails, urls); 664 passParameters(&e, parameters2, emails, urls);
646 665
647 666
648 667
649#else 668#else
650 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 669 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
651#endif 670#endif
652 671
653 return true; 672 return true;
654} 673}
655 674
@@ -679,34 +698,36 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
679 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client); 698 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client);
680 if (!dai) 699 if (!dai)
681 { 700 {
682 qDebug("could not find configured email application."); 701 qDebug("could not find configured email application.");
683 return false; 702 return false;
684 } 703 }
685 channel = dai->_channel; 704 channel = dai->_channel;
686 message = dai->_message; 705 message = dai->_message;
687 parameters = dai->_parameters; 706 parameters = dai->_parameters;
688 } 707 }
689 708
690 709
691 //first check if one of the mailers need the emails right in the message. 710 //first check if one of the mailers need the emails right in the message.
692 message = translateMessage(message, name, emailadress); 711 message = translateMessage(message, name, emailadress);
693 712
694 713
714#ifdef DEBUG_EXT_APP_HANDLER
695 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 715 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
696 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); 716 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1());
717#endif
697 718
698 QCopEnvelope e(channel.latin1(), message.latin1()); 719 QCopEnvelope e(channel.latin1(), message.latin1());
699 //US we need no names in the To field. The emailadresses are enough 720 //US we need no names in the To field. The emailadresses are enough
700 721
701 passParameters(&e, parameters, name, emailadress); 722 passParameters(&e, parameters, name, emailadress);
702 723
703 724
704#else 725#else
705 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 726 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
706#endif 727#endif
707 728
708 729
709 return true; 730 return true;
710} 731}
711 732
712/************************************************************************** 733/**************************************************************************
@@ -756,34 +777,36 @@ bool ExternalAppHandler::callByPhone( const QString& phonenumber )
756 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client); 777 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client);
757 if (!dai) 778 if (!dai)
758 { 779 {
759 qDebug("could not find configured phone application."); 780 qDebug("could not find configured phone application.");
760 return false; 781 return false;
761 } 782 }
762 channel = dai->_channel; 783 channel = dai->_channel;
763 message = dai->_message; 784 message = dai->_message;
764 parameters = dai->_parameters; 785 parameters = dai->_parameters;
765 } 786 }
766 787
767 788
768 //first check if one of the mailers need the emails right in the message. 789 //first check if one of the mailers need the emails right in the message.
769 message = translateMessage(message, phonenumber, ""); 790 message = translateMessage(message, phonenumber, "");
770 791
771 792
793#ifdef DEBUG_EXT_APP_HANDLER
772 qDebug("6Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 794 qDebug("6Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
773 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 795 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
796#endif
774 797
775 QCopEnvelope e(channel.latin1(), message.latin1()); 798 QCopEnvelope e(channel.latin1(), message.latin1());
776 //US we need no names in the To field. The emailadresses are enough 799 //US we need no names in the To field. The emailadresses are enough
777 800
778 passParameters(&e, parameters, phonenumber, ""); 801 passParameters(&e, parameters, phonenumber, "");
779 802
780 803
781#else 804#else
782 KMessageBox::sorry( 0, i18n( "This version does not support phonecalls." ) ); 805 KMessageBox::sorry( 0, i18n( "This version does not support phonecalls." ) );
783#endif 806#endif
784 807
785 808
786 return true; 809 return true;
787} 810}
788 811
789/************************************************************************** 812/**************************************************************************
@@ -811,34 +834,36 @@ bool ExternalAppHandler::callBySMS( const QString& phonenumber )
811 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SMS, client); 834 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SMS, client);
812 if (!dai) 835 if (!dai)
813 { 836 {
814 qDebug("could not find configured sms application."); 837 qDebug("could not find configured sms application.");
815 return false; 838 return false;
816 } 839 }
817 channel = dai->_channel; 840 channel = dai->_channel;
818 message = dai->_message; 841 message = dai->_message;
819 parameters = dai->_parameters; 842 parameters = dai->_parameters;
820 } 843 }
821 844
822 845
823 //first check if one of the mailers need the emails right in the message. 846 //first check if one of the mailers need the emails right in the message.
824 message = translateMessage(message, phonenumber, ""); 847 message = translateMessage(message, phonenumber, "");
825 848
826 849
850#ifdef DEBUG_EXT_APP_HANDLER
827 qDebug("7Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 851 qDebug("7Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
828 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 852 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
853#endif
829 854
830 QCopEnvelope e(channel.latin1(), message.latin1()); 855 QCopEnvelope e(channel.latin1(), message.latin1());
831 //US we need no names in the To field. The emailadresses are enough 856 //US we need no names in the To field. The emailadresses are enough
832 857
833 passParameters(&e, parameters, phonenumber, ""); 858 passParameters(&e, parameters, phonenumber, "");
834 859
835 860
836#else 861#else
837 KMessageBox::sorry( 0, i18n( "This version does not support the sending of sms." ) ); 862 KMessageBox::sorry( 0, i18n( "This version does not support the sending of sms." ) );
838#endif 863#endif
839 864
840 865
841 return true; 866 return true;
842} 867}
843 868
844/************************************************************************** 869/**************************************************************************
@@ -866,34 +891,36 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber )
866 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PAGER, client); 891 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PAGER, client);
867 if (!dai) 892 if (!dai)
868 { 893 {
869 qDebug("could not find configured pager application."); 894 qDebug("could not find configured pager application.");
870 return false; 895 return false;
871 } 896 }
872 channel = dai->_channel; 897 channel = dai->_channel;
873 message = dai->_message; 898 message = dai->_message;
874 parameters = dai->_parameters; 899 parameters = dai->_parameters;
875 } 900 }
876 901
877 902
878 //first check if one of the mailers need the emails right in the message. 903 //first check if one of the mailers need the emails right in the message.
879 message = translateMessage(message, pagernumber, ""); 904 message = translateMessage(message, pagernumber, "");
880 905
881 906
907#ifdef DEBUG_EXT_APP_HANDLER
882 qDebug("8Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 908 qDebug("8Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
883 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1()); 909 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1());
910#endif
884 911
885 QCopEnvelope e(channel.latin1(), message.latin1()); 912 QCopEnvelope e(channel.latin1(), message.latin1());
886 //US we need no names in the To field. The emailadresses are enough 913 //US we need no names in the To field. The emailadresses are enough
887 914
888 passParameters(&e, parameters, pagernumber, ""); 915 passParameters(&e, parameters, pagernumber, "");
889 916
890 917
891#else 918#else
892 KMessageBox::sorry( 0, i18n( "This version does not support paging." ) ); 919 KMessageBox::sorry( 0, i18n( "This version does not support paging." ) );
893#endif 920#endif
894 921
895 922
896 return true; 923 return true;
897} 924}
898 925
899/************************************************************************** 926/**************************************************************************
@@ -921,34 +948,36 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber )
921 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client); 948 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client);
922 if (!dai) 949 if (!dai)
923 { 950 {
924 qDebug("could not find configured fax application."); 951 qDebug("could not find configured fax application.");
925 return false; 952 return false;
926 } 953 }
927 channel = dai->_channel; 954 channel = dai->_channel;
928 message = dai->_message; 955 message = dai->_message;
929 parameters = dai->_parameters; 956 parameters = dai->_parameters;
930 } 957 }
931 958
932 959
933 //first check if one of the mailers need the emails right in the message. 960 //first check if one of the mailers need the emails right in the message.
934 message = translateMessage(message, faxnumber, ""); 961 message = translateMessage(message, faxnumber, "");
935 962
936 963
964#ifdef DEBUG_EXT_APP_HANDLER
937 qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 965 qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
938 qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1()); 966 qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1());
967#endif
939 968
940 QCopEnvelope e(channel.latin1(), message.latin1()); 969 QCopEnvelope e(channel.latin1(), message.latin1());
941 //US we need no names in the To field. The emailadresses are enough 970 //US we need no names in the To field. The emailadresses are enough
942 971
943 passParameters(&e, parameters, faxnumber, ""); 972 passParameters(&e, parameters, faxnumber, "");
944 973
945 974
946#else 975#else
947 KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) ); 976 KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) );
948#endif 977#endif
949 978
950 979
951 return true; 980 return true;
952} 981}
953 982
954/************************************************************************** 983/**************************************************************************
@@ -976,34 +1005,36 @@ bool ExternalAppHandler::callBySIP( const QString& sipnumber )
976 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client); 1005 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client);
977 if (!dai) 1006 if (!dai)
978 { 1007 {
979 qDebug("could not find configured sip application."); 1008 qDebug("could not find configured sip application.");
980 return false; 1009 return false;
981 } 1010 }
982 channel = dai->_channel; 1011 channel = dai->_channel;
983 message = dai->_message; 1012 message = dai->_message;
984 parameters = dai->_parameters; 1013 parameters = dai->_parameters;
985 } 1014 }
986 1015
987 1016
988 //first check if one of the sip apps need the emails right in the message. 1017 //first check if one of the sip apps need the emails right in the message.
989 message = translateMessage(message, sipnumber, ""); 1018 message = translateMessage(message, sipnumber, "");
990 1019
991 1020
1021#ifdef DEBUG_EXT_APP_HANDLER
992 qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 1022 qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
993 qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); 1023 qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1());
1024#endif
994 1025
995 QCopEnvelope e(channel.latin1(), message.latin1()); 1026 QCopEnvelope e(channel.latin1(), message.latin1());
996 //US we need no names in the To field. The emailadresses are enough 1027 //US we need no names in the To field. The emailadresses are enough
997 1028
998 passParameters(&e, parameters, sipnumber, ""); 1029 passParameters(&e, parameters, sipnumber, "");
999 1030
1000 1031
1001#else 1032#else
1002 KMessageBox::sorry( 0, i18n( "This version does not support sip." ) ); 1033 KMessageBox::sorry( 0, i18n( "This version does not support sip." ) );
1003#endif 1034#endif
1004 1035
1005 1036
1006 return true; 1037 return true;
1007} 1038}
1008 1039
1009 1040