summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.cpp
Unidiff
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index fa56ee9..99aee86 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -60,80 +60,80 @@ QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sour
60 if (_usedSourceParameters == 0) 60 if (_usedSourceParameters == 0)
61 _sourceMessageParameters = "(QString,QString)"; 61 _sourceMessageParameters = "(QString,QString)";
62 else if (_usedSourceParameters == 1) 62 else if (_usedSourceParameters == 1)
63 _sourceMessageParameters = "(QString,QString,QString)"; 63 _sourceMessageParameters = "(QString,QString,QString)";
64 else if (_usedSourceParameters == 2) 64 else if (_usedSourceParameters == 2)
65 _sourceMessageParameters = "(QString,QString,QString,QString)"; 65 _sourceMessageParameters = "(QString,QString,QString,QString)";
66 else if (_usedSourceParameters == 3) 66 else if (_usedSourceParameters == 3)
67 _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; 67 _sourceMessageParameters = "(QString,QString,QString,QString,QString)";
68} 68}
69 69
70/*********************************************************************************/ 70/*********************************************************************************/
71 71
72QCopTransferItem::QCopTransferItem() 72QCopTransferItem::QCopTransferItem()
73{ 73{
74} 74}
75 75
76/*********************************************************************************/ 76/*********************************************************************************/
77bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) 77bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3)
78{ 78{
79 79
80#ifndef DESKTOP_VERSION 80#ifndef DESKTOP_VERSION
81 //sourceMessage passes two parameters: sourceChannel, uid 81 //sourceMessage passes two parameters: sourceChannel, uid
82 QString sourceMessage = _sourceMessage + _sourceMessageParameters; 82 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
83 83
84 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 84 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()); 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());
86 86
87 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 87 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
88 88
89 e << _sourceChannel << uid; 89 e << _sourceChannel << uid;
90 90
91 if (_usedSourceParameters == 1) 91 if (_usedSourceParameters == 1)
92 e << param1; 92 e << param1;
93 else if (_usedSourceParameters == 2) 93 else if (_usedSourceParameters == 2)
94 e << param1 << param2; 94 e << param1 << param2;
95 else if (_usedSourceParameters == 3) 95 else if (_usedSourceParameters == 3)
96 e << param1 << param2 << param3; 96 e << param1 << param2 << param3;
97 97
98 qApp->processEvents(); 98 qApp->processEvents();
99 99
100 return true; 100 return true;
101 101
102#else 102#else
103 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 103 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
104 return false; 104 return false;
105#endif 105#endif
106 106
107} 107}
108 108
109 109
110/*********************************************************************************/ 110/*********************************************************************************/
111void QCopTransferItem::setSourceChannel(const QString& sourceChannel) 111void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
112{ 112{
113 113
114 if (_sourceChannel.isEmpty()) 114 if ( !sourceChannel.isEmpty())
115 _sourceChannel = sourceChannel; 115 _sourceChannel = sourceChannel;
116} 116}
117 117
118 118
119/*********************************************************************************/ 119/*********************************************************************************/
120bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 120bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
121{ 121{
122 122
123 // copied from old mail2 123 // copied from old mail2
124/* 124/*
125 static int ii = 0; 125 static int ii = 0;
126 126
127 // block second call 127 // block second call
128 if ( ii < 2 ) { 128 if ( ii < 2 ) {
129 ++ii; 129 ++ii;
130 if ( ii > 1 ) { 130 if ( ii > 1 ) {
131 qDebug("qcop call blocked "); 131 qDebug("qcop call blocked ");
132 return true; 132 return true;
133 } 133 }
134 } 134 }
135*/ 135*/
136 136
137// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); 137// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() );
138 138
139 //we are in the target and get a request from the source 139 //we are in the target and get a request from the source
@@ -176,49 +176,49 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data
176 176
177 return false; 177 return false;
178} 178}
179 179
180 180
181/********************************************************************************* 181/*********************************************************************************
182 * 182 *
183 ********************************************************************************/ 183 ********************************************************************************/
184 184
185 185
186QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 186QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
187 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 187 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
188{ 188{
189 //targetMessage returns later two parameters: uid, and map<qstring,qstring> 189 //targetMessage returns later two parameters: uid, and map<qstring,qstring>
190 _targetMessageParameters = "(QString,QMAP<QString,QString>)"; 190 _targetMessageParameters = "(QString,QMAP<QString,QString>)";
191} 191}
192 192
193/*********************************************************************************/ 193/*********************************************************************************/
194bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap) 194bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
195{ 195{
196#ifndef DESKTOP_VERSION 196#ifndef DESKTOP_VERSION
197 //targetMessage passes two parameters: uid, map 197 //targetMessage passes two parameters: uid, map
198 QString targetMessage = _targetMessage + _targetMessageParameters; 198 QString targetMessage = _targetMessage + _targetMessageParameters;
199 199
200 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 200 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
201 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1()); 201 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1());
202 202
203 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 203 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
204 //US we need no names in the To field. The emailadresses are enough 204 //US we need no names in the To field. The emailadresses are enough
205 205
206 e << uid << nameEmailMap; 206 e << uid << nameEmailMap;
207 207
208 qApp->processEvents(); 208 qApp->processEvents();
209 209
210 return true; 210 return true;
211 211
212#else 212#else
213 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 213 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
214 return false; 214 return false;
215#endif 215#endif
216 216
217} 217}
218 218
219 219
220/*********************************************************************************/ 220/*********************************************************************************/
221bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 221bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
222{ 222{
223 bool res = QCopTransferItem::appMessage( cmsg, data ); 223 bool res = QCopTransferItem::appMessage( cmsg, data );
224 224
@@ -245,78 +245,79 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da
245 245
246 return false; 246 return false;
247} 247}
248 248
249 249
250/********************************************************************************* 250/*********************************************************************************
251 * 251 *
252 ********************************************************************************/ 252 ********************************************************************************/
253 253
254 254
255QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) 255QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
256 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) 256 : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
257{ 257{
258 //targetMessage returns later two parameters: uid, and three lists 258 //targetMessage returns later two parameters: uid, and three lists
259 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)"; 259 _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)";
260} 260}
261 261
262/*********************************************************************************/ 262/*********************************************************************************/
263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
264{ 264{
265#ifndef DESKTOP_VERSION 265#ifndef DESKTOP_VERSION
266 //targetMessage passes two parameters: uid, map 266 //targetMessage passes two parameters: uid, map
267 QString targetMessage = _targetMessage + _targetMessageParameters; 267 QString targetMessage = _targetMessage + _targetMessageParameters;
268 268
269 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 269 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
270 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1()); 270 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1());
271 271
272 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 272 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
273 //US we need no names in the To field. The emailadresses are enough 273 //US we need no names in the To field. The emailadresses are enough
274 274
275 e << uid << list1 << list2 << list3; 275 e << uid << list1 << list2 << list3;
276 276
277 qApp->processEvents(); 277 qApp->processEvents();
278 278
279 return true; 279 return true;
280 280
281#else 281#else
282 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); 282 KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) );
283 return false; 283 return false;
284#endif 284#endif
285 285
286} 286}
287 287
288 288
289/*********************************************************************************/ 289/*********************************************************************************/
290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
291{ 291{
292 bool res = QCopTransferItem::appMessage( cmsg, data ); 292 bool res = QCopTransferItem::appMessage( cmsg, data );
293 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
293 294
294 if (res == false) 295 if (res == false)
295 { 296 {
296 QDataStream stream( data, IO_ReadOnly ); 297 QDataStream stream( data, IO_ReadOnly );
297 298
298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 299 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
299 300
300 //we are in the source and get an answer from the target 301 //we are in the source and get an answer from the target
301 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 302 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
302 { 303 {
303 QStringList list1; 304 QStringList list1;
304 QStringList list2; 305 QStringList list2;
305 QStringList list3; 306 QStringList list3;
306 QString uid; 307 QString uid;
307 308
308 stream >> uid >> list1 >> list2 >> list3; 309 stream >> uid >> list1 >> list2 >> list3;
309 emit receivedMessageFromTarget(uid, list1, list2, list3); 310 emit receivedMessageFromTarget(uid, list1, list2, list3);
310 311
311 312
312 return true; 313 return true;
313 } 314 }
314 } 315 }
315 316
316 return false; 317 return false;
317} 318}
318 319
319 320
320 321
321/********************************************************************************* 322/*********************************************************************************
322 * 323 *
@@ -583,49 +584,49 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS
583 int client = KPimGlobalPrefs::instance()->mEmailClient; 584 int client = KPimGlobalPrefs::instance()->mEmailClient;
584 if (client == KPimGlobalPrefs::OTHER_EMC) 585 if (client == KPimGlobalPrefs::OTHER_EMC)
585 { 586 {
586 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel; 587 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel;
587 message2 = KPimGlobalPrefs::instance()->mEmailOtherMessage; 588 message2 = KPimGlobalPrefs::instance()->mEmailOtherMessage;
588 parameters2 = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters; 589 parameters2 = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters;
589 } 590 }
590 else 591 else
591 { 592 {
592 DefaultAppItem* dai = getDefaultItem(EMAIL, client); 593 DefaultAppItem* dai = getDefaultItem(EMAIL, client);
593 if (!dai) 594 if (!dai)
594 { 595 {
595 qDebug("could not find configured email application."); 596 qDebug("could not find configured email application.");
596 return false; 597 return false;
597 } 598 }
598 channel = dai->_channel; 599 channel = dai->_channel;
599 message2 = dai->_message2; 600 message2 = dai->_message2;
600 parameters2 = dai->_parameters2; 601 parameters2 = dai->_parameters2;
601 } 602 }
602 603
603 //first check if one of the mailers need the emails right in the message. 604 //first check if one of the mailers need the emails right in the message.
604 message2 = translateMessage(message2, emails, urls); 605 message2 = translateMessage(message2, emails, urls);
605 606
606 607
607 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); 608 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1());
608 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); 609 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1());
609 610
610 611
611 QCopEnvelope e(channel.latin1(), message2.latin1()); 612 QCopEnvelope e(channel.latin1(), message2.latin1());
612 //US we need no names in the To field. The emailadresses are enough 613 //US we need no names in the To field. The emailadresses are enough
613 614
614 passParameters(&e, parameters2, emails, urls); 615 passParameters(&e, parameters2, emails, urls);
615 616
616 617
617 618
618#else 619#else
619 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 620 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
620#endif 621#endif
621 622
622 return true; 623 return true;
623} 624}
624 625
625/************************************************************************** 626/**************************************************************************
626 * 627 *
627 **************************************************************************/ 628 **************************************************************************/
628 629
629 630
630//calls the emailapplication and creates a mail with parameter emails as recipients 631//calls the emailapplication and creates a mail with parameter emails as recipients
631bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress ) 632bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress )
@@ -640,49 +641,49 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
640 if (client == KPimGlobalPrefs::OTHER_EMC) 641 if (client == KPimGlobalPrefs::OTHER_EMC)
641 { 642 {
642 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel; 643 channel = KPimGlobalPrefs::instance()->mEmailOtherChannel;
643 message = KPimGlobalPrefs::instance()->mEmailOtherMessage; 644 message = KPimGlobalPrefs::instance()->mEmailOtherMessage;
644 parameters = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters; 645 parameters = KPimGlobalPrefs::instance()->mEmailOtherMessageParameters;
645 } 646 }
646 else 647 else
647 { 648 {
648 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client); 649 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(EMAIL, client);
649 if (!dai) 650 if (!dai)
650 { 651 {
651 qDebug("could not find configured email application."); 652 qDebug("could not find configured email application.");
652 return false; 653 return false;
653 } 654 }
654 channel = dai->_channel; 655 channel = dai->_channel;
655 message = dai->_message; 656 message = dai->_message;
656 parameters = dai->_parameters; 657 parameters = dai->_parameters;
657 } 658 }
658 659
659 660
660 //first check if one of the mailers need the emails right in the message. 661 //first check if one of the mailers need the emails right in the message.
661 message = translateMessage(message, name, emailadress); 662 message = translateMessage(message, name, emailadress);
662 663
663 664
664 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 665 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
665 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); 666 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1());
666 667
667 QCopEnvelope e(channel.latin1(), message.latin1()); 668 QCopEnvelope e(channel.latin1(), message.latin1());
668 //US we need no names in the To field. The emailadresses are enough 669 //US we need no names in the To field. The emailadresses are enough
669 670
670 passParameters(&e, parameters, name, emailadress); 671 passParameters(&e, parameters, name, emailadress);
671 672
672 673
673#else 674#else
674 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) ); 675 KMessageBox::sorry( 0, i18n( "This version does not support the sending of emails." ) );
675#endif 676#endif
676 677
677 678
678 return true; 679 return true;
679} 680}
680 681
681/************************************************************************** 682/**************************************************************************
682 * 683 *
683 **************************************************************************/ 684 **************************************************************************/
684 685
685//calls the emailapplication and creates a mail with parameter as recipients 686//calls the emailapplication and creates a mail with parameter as recipients
686// parameters format is 687// parameters format is
687// NAME <EMAIL>:SUBJECT 688// NAME <EMAIL>:SUBJECT
688bool ExternalAppHandler::mailToOneContact( const QString& adressline ) 689bool ExternalAppHandler::mailToOneContact( const QString& adressline )
@@ -717,49 +718,49 @@ bool ExternalAppHandler::callByPhone( const QString& phonenumber )
717 if (client == KPimGlobalPrefs::OTHER_PHC) 718 if (client == KPimGlobalPrefs::OTHER_PHC)
718 { 719 {
719 channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel; 720 channel = KPimGlobalPrefs::instance()->mPhoneOtherChannel;
720 message = KPimGlobalPrefs::instance()->mPhoneOtherMessage; 721 message = KPimGlobalPrefs::instance()->mPhoneOtherMessage;
721 parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters; 722 parameters = KPimGlobalPrefs::instance()->mPhoneOtherMessageParameters;
722 } 723 }
723 else 724 else
724 { 725 {
725 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client); 726 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PHONE, client);
726 if (!dai) 727 if (!dai)
727 { 728 {
728 qDebug("could not find configured phone application."); 729 qDebug("could not find configured phone application.");
729 return false; 730 return false;
730 } 731 }
731 channel = dai->_channel; 732 channel = dai->_channel;
732 message = dai->_message; 733 message = dai->_message;
733 parameters = dai->_parameters; 734 parameters = dai->_parameters;
734 } 735 }
735 736
736 737
737 //first check if one of the mailers need the emails right in the message. 738 //first check if one of the mailers need the emails right in the message.
738 message = translateMessage(message, phonenumber, ""); 739 message = translateMessage(message, phonenumber, "");
739 740
740 741
741 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 742 qDebug("6Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
742 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 743 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
743 744
744 QCopEnvelope e(channel.latin1(), message.latin1()); 745 QCopEnvelope e(channel.latin1(), message.latin1());
745 //US we need no names in the To field. The emailadresses are enough 746 //US we need no names in the To field. The emailadresses are enough
746 747
747 passParameters(&e, parameters, phonenumber, ""); 748 passParameters(&e, parameters, phonenumber, "");
748 749
749 750
750#else 751#else
751 KMessageBox::sorry( 0, i18n( "This version does not support phonecalls." ) ); 752 KMessageBox::sorry( 0, i18n( "This version does not support phonecalls." ) );
752#endif 753#endif
753 754
754 755
755 return true; 756 return true;
756} 757}
757 758
758/************************************************************************** 759/**************************************************************************
759 * 760 *
760 **************************************************************************/ 761 **************************************************************************/
761 762
762//calls the smsapplication with the number 763//calls the smsapplication with the number
763bool ExternalAppHandler::callBySMS( const QString& phonenumber ) 764bool ExternalAppHandler::callBySMS( const QString& phonenumber )
764{ 765{
765#ifndef DESKTOP_VERSION 766#ifndef DESKTOP_VERSION
@@ -772,49 +773,49 @@ bool ExternalAppHandler::callBySMS( const QString& phonenumber )
772 if (client == KPimGlobalPrefs::OTHER_SMC) 773 if (client == KPimGlobalPrefs::OTHER_SMC)
773 { 774 {
774 channel = KPimGlobalPrefs::instance()->mSMSOtherChannel; 775 channel = KPimGlobalPrefs::instance()->mSMSOtherChannel;
775 message = KPimGlobalPrefs::instance()->mSMSOtherMessage; 776 message = KPimGlobalPrefs::instance()->mSMSOtherMessage;
776 parameters = KPimGlobalPrefs::instance()->mSMSOtherMessageParameters; 777 parameters = KPimGlobalPrefs::instance()->mSMSOtherMessageParameters;
777 } 778 }
778 else 779 else
779 { 780 {
780 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SMS, client); 781 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SMS, client);
781 if (!dai) 782 if (!dai)
782 { 783 {
783 qDebug("could not find configured sms application."); 784 qDebug("could not find configured sms application.");
784 return false; 785 return false;
785 } 786 }
786 channel = dai->_channel; 787 channel = dai->_channel;
787 message = dai->_message; 788 message = dai->_message;
788 parameters = dai->_parameters; 789 parameters = dai->_parameters;
789 } 790 }
790 791
791 792
792 //first check if one of the mailers need the emails right in the message. 793 //first check if one of the mailers need the emails right in the message.
793 message = translateMessage(message, phonenumber, ""); 794 message = translateMessage(message, phonenumber, "");
794 795
795 796
796 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 797 qDebug("7Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
797 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 798 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
798 799
799 QCopEnvelope e(channel.latin1(), message.latin1()); 800 QCopEnvelope e(channel.latin1(), message.latin1());
800 //US we need no names in the To field. The emailadresses are enough 801 //US we need no names in the To field. The emailadresses are enough
801 802
802 passParameters(&e, parameters, phonenumber, ""); 803 passParameters(&e, parameters, phonenumber, "");
803 804
804 805
805#else 806#else
806 KMessageBox::sorry( 0, i18n( "This version does not support the sending of sms." ) ); 807 KMessageBox::sorry( 0, i18n( "This version does not support the sending of sms." ) );
807#endif 808#endif
808 809
809 810
810 return true; 811 return true;
811} 812}
812 813
813/************************************************************************** 814/**************************************************************************
814 * 815 *
815 **************************************************************************/ 816 **************************************************************************/
816 817
817//calls the pagerapplication with the number 818//calls the pagerapplication with the number
818bool ExternalAppHandler::callByPager( const QString& pagernumber ) 819bool ExternalAppHandler::callByPager( const QString& pagernumber )
819{ 820{
820#ifndef DESKTOP_VERSION 821#ifndef DESKTOP_VERSION
@@ -827,49 +828,49 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber )
827 if (client == KPimGlobalPrefs::OTHER_PAC) 828 if (client == KPimGlobalPrefs::OTHER_PAC)
828 { 829 {
829 channel = KPimGlobalPrefs::instance()->mPagerOtherChannel; 830 channel = KPimGlobalPrefs::instance()->mPagerOtherChannel;
830 message = KPimGlobalPrefs::instance()->mPagerOtherMessage; 831 message = KPimGlobalPrefs::instance()->mPagerOtherMessage;
831 parameters = KPimGlobalPrefs::instance()->mPagerOtherMessageParameters; 832 parameters = KPimGlobalPrefs::instance()->mPagerOtherMessageParameters;
832 } 833 }
833 else 834 else
834 { 835 {
835 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PAGER, client); 836 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(PAGER, client);
836 if (!dai) 837 if (!dai)
837 { 838 {
838 qDebug("could not find configured pager application."); 839 qDebug("could not find configured pager application.");
839 return false; 840 return false;
840 } 841 }
841 channel = dai->_channel; 842 channel = dai->_channel;
842 message = dai->_message; 843 message = dai->_message;
843 parameters = dai->_parameters; 844 parameters = dai->_parameters;
844 } 845 }
845 846
846 847
847 //first check if one of the mailers need the emails right in the message. 848 //first check if one of the mailers need the emails right in the message.
848 message = translateMessage(message, pagernumber, ""); 849 message = translateMessage(message, pagernumber, "");
849 850
850 851
851 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 852 qDebug("8Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
852 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1()); 853 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1());
853 854
854 QCopEnvelope e(channel.latin1(), message.latin1()); 855 QCopEnvelope e(channel.latin1(), message.latin1());
855 //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
856 857
857 passParameters(&e, parameters, pagernumber, ""); 858 passParameters(&e, parameters, pagernumber, "");
858 859
859 860
860#else 861#else
861 KMessageBox::sorry( 0, i18n( "This version does not support paging." ) ); 862 KMessageBox::sorry( 0, i18n( "This version does not support paging." ) );
862#endif 863#endif
863 864
864 865
865 return true; 866 return true;
866} 867}
867 868
868/************************************************************************** 869/**************************************************************************
869 * 870 *
870 **************************************************************************/ 871 **************************************************************************/
871 872
872//calls the faxapplication with the number 873//calls the faxapplication with the number
873bool ExternalAppHandler::callByFax( const QString& faxnumber ) 874bool ExternalAppHandler::callByFax( const QString& faxnumber )
874{ 875{
875#ifndef DESKTOP_VERSION 876#ifndef DESKTOP_VERSION
@@ -882,49 +883,49 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber )
882 if (client == KPimGlobalPrefs::OTHER_FAC) 883 if (client == KPimGlobalPrefs::OTHER_FAC)
883 { 884 {
884 channel = KPimGlobalPrefs::instance()->mFaxOtherChannel; 885 channel = KPimGlobalPrefs::instance()->mFaxOtherChannel;
885 message = KPimGlobalPrefs::instance()->mFaxOtherMessage; 886 message = KPimGlobalPrefs::instance()->mFaxOtherMessage;
886 parameters = KPimGlobalPrefs::instance()->mFaxOtherMessageParameters; 887 parameters = KPimGlobalPrefs::instance()->mFaxOtherMessageParameters;
887 } 888 }
888 else 889 else
889 { 890 {
890 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client); 891 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client);
891 if (!dai) 892 if (!dai)
892 { 893 {
893 qDebug("could not find configured fax application."); 894 qDebug("could not find configured fax application.");
894 return false; 895 return false;
895 } 896 }
896 channel = dai->_channel; 897 channel = dai->_channel;
897 message = dai->_message; 898 message = dai->_message;
898 parameters = dai->_parameters; 899 parameters = dai->_parameters;
899 } 900 }
900 901
901 902
902 //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.
903 message = translateMessage(message, faxnumber, ""); 904 message = translateMessage(message, faxnumber, "");
904 905
905 906
906 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 907 qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
907 qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1()); 908 qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1());
908 909
909 QCopEnvelope e(channel.latin1(), message.latin1()); 910 QCopEnvelope e(channel.latin1(), message.latin1());
910 //US we need no names in the To field. The emailadresses are enough 911 //US we need no names in the To field. The emailadresses are enough
911 912
912 passParameters(&e, parameters, faxnumber, ""); 913 passParameters(&e, parameters, faxnumber, "");
913 914
914 915
915#else 916#else
916 KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) ); 917 KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) );
917#endif 918#endif
918 919
919 920
920 return true; 921 return true;
921} 922}
922 923
923/************************************************************************** 924/**************************************************************************
924 * 925 *
925 **************************************************************************/ 926 **************************************************************************/
926 927
927//calls the sipapplication with the number 928//calls the sipapplication with the number
928bool ExternalAppHandler::callBySIP( const QString& sipnumber ) 929bool ExternalAppHandler::callBySIP( const QString& sipnumber )
929{ 930{
930#ifndef DESKTOP_VERSION 931#ifndef DESKTOP_VERSION
@@ -937,49 +938,49 @@ bool ExternalAppHandler::callBySIP( const QString& sipnumber )
937 if (client == KPimGlobalPrefs::OTHER_SIC) 938 if (client == KPimGlobalPrefs::OTHER_SIC)
938 { 939 {
939 channel = KPimGlobalPrefs::instance()->mSipOtherChannel; 940 channel = KPimGlobalPrefs::instance()->mSipOtherChannel;
940 message = KPimGlobalPrefs::instance()->mSipOtherMessage; 941 message = KPimGlobalPrefs::instance()->mSipOtherMessage;
941 parameters = KPimGlobalPrefs::instance()->mSipOtherMessageParameters; 942 parameters = KPimGlobalPrefs::instance()->mSipOtherMessageParameters;
942 } 943 }
943 else 944 else
944 { 945 {
945 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client); 946 DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client);
946 if (!dai) 947 if (!dai)
947 { 948 {
948 qDebug("could not find configured sip application."); 949 qDebug("could not find configured sip application.");
949 return false; 950 return false;
950 } 951 }
951 channel = dai->_channel; 952 channel = dai->_channel;
952 message = dai->_message; 953 message = dai->_message;
953 parameters = dai->_parameters; 954 parameters = dai->_parameters;
954 } 955 }
955 956
956 957
957 //first check if one of the sip apps need the emails right in the message. 958 //first check if one of the sip apps need the emails right in the message.
958 message = translateMessage(message, sipnumber, ""); 959 message = translateMessage(message, sipnumber, "");
959 960
960 961
961 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 962 qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
962 qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); 963 qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1());
963 964
964 QCopEnvelope e(channel.latin1(), message.latin1()); 965 QCopEnvelope e(channel.latin1(), message.latin1());
965 //US we need no names in the To field. The emailadresses are enough 966 //US we need no names in the To field. The emailadresses are enough
966 967
967 passParameters(&e, parameters, sipnumber, ""); 968 passParameters(&e, parameters, sipnumber, "");
968 969
969 970
970#else 971#else
971 KMessageBox::sorry( 0, i18n( "This version does not support sip." ) ); 972 KMessageBox::sorry( 0, i18n( "This version does not support sip." ) );
972#endif 973#endif
973 974
974 975
975 return true; 976 return true;
976} 977}
977 978
978 979
979/************************************************************************** 980/**************************************************************************
980 * 981 *
981 **************************************************************************/ 982 **************************************************************************/
982 983
983 984
984QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const 985QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const
985{ 986{
@@ -1043,48 +1044,49 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
1043/************************************************************************** 1044/**************************************************************************
1044 * 1045 *
1045 **************************************************************************/ 1046 **************************************************************************/
1046 1047
1047void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) 1048void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
1048{ 1049{
1049 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); 1050 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
1050 if (!res) 1051 if (!res)
1051 res = mDisplayDetails->appMessage( cmsg, data ); 1052 res = mDisplayDetails->appMessage( cmsg, data );
1052 1053
1053// if (!res) 1054// if (!res)
1054// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); 1055// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
1055} 1056}
1056 1057
1057 1058
1058 1059
1059bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) 1060bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
1060{ 1061{
1061 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 1062 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
1062 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); 1063 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid);
1063} 1064}
1064 1065
1065bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 1066bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
1066{ 1067{
1068
1067 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 1069 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
1068 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); 1070 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
1069} 1071}
1070 1072
1071bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) 1073bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email)
1072{ 1074{
1073 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); 1075 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
1074 return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); 1076 return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email);
1075} 1077}
1076 1078
1077bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 1079bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
1078{ 1080{
1079 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); 1081 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
1080 return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); 1082 return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
1081} 1083}
1082 1084
1083bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) 1085bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid)
1084{ 1086{
1085 mDisplayDetails->setSourceChannel(""); 1087 mDisplayDetails->setSourceChannel("");
1086 return mDisplayDetails->sendMessageToTarget("", name, email, uid); 1088 return mDisplayDetails->sendMessageToTarget("", name, email, uid);
1087} 1089}
1088 1090
1089 1091
1090 1092