summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp37
-rw-r--r--libkdepim/kpimglobalprefs.cpp2
-rw-r--r--libkdepim/kpimglobalprefs.h3
3 files changed, 37 insertions, 5 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 07bdff2..779b20e 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -47,8 +47,11 @@ $Id$
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
@@ -79,11 +82,12 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa
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;
@@ -196,10 +200,12 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt
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
@@ -265,14 +271,16 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString
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
@@ -293,15 +301,19 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString
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 {
@@ -312,9 +324,11 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d
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
@@ -435,10 +449,13 @@ void ExternalAppHandler::loadConfig()
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()
@@ -634,10 +651,12 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS
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
@@ -691,10 +710,12 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
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
@@ -768,10 +789,12 @@ bool ExternalAppHandler::callByPhone( const QString& phonenumber )
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
@@ -823,10 +846,12 @@ bool ExternalAppHandler::callBySMS( const QString& phonenumber )
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
@@ -878,10 +903,12 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber )
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
@@ -933,10 +960,12 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber )
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
@@ -988,10 +1017,12 @@ bool ExternalAppHandler::callBySIP( const QString& sipnumber )
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
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 04e2072..7cd6038 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -91,9 +91,9 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
91 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 91 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
92 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 92 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
93 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 93 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
94 94
95 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); 95 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC );
96 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 96 addItemString( "SIPChannel", &mSipOtherChannel, "" );
97 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 97 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
98 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 98 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
99 99
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index 7c55099..d09c3da 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -74,9 +74,10 @@ class KPimGlobalPrefs : public KPrefs
74 }; 74 };
75 75
76 enum SIPClients { 76 enum SIPClients {
77 NONE_SIC = 0, 77 NONE_SIC = 0,
78 OTHER_SIC = 1 78 OTHER_SIC = 1,
79 KPPI_SIC = 2
79 }; 80 };
80 81
81 private: 82 private:
82 KPimGlobalPrefs( const QString &name = QString::null ); 83 KPimGlobalPrefs( const QString &name = QString::null );