summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.cpp
Unidiff
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp52
1 files changed, 35 insertions, 17 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index b57506b..bd83626 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -35,5 +35,8 @@ $Id$
35 35
36#ifndef DESKTOP_VERSION 36#ifndef DESKTOP_VERSION
37#include <qpe/qpeapplication.h>
37#include <qtopia/qcopenvelope_qws.h> 38#include <qtopia/qcopenvelope_qws.h>
39#else
40#include <qapplication.h>
38#endif 41#endif
39 42
@@ -55,5 +58,12 @@ QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sour
55{ 58{
56 //sourceMessage passes later three parameters: sourceChannel, uid, param1 59 //sourceMessage passes later three parameters: sourceChannel, uid, param1
57 _sourceMessageParameters = "(QString,QString,QString)"; 60 if (_usedSourceParameters == 0)
61 _sourceMessageParameters = "(QString,QString)";
62 else if (_usedSourceParameters == 1)
63 _sourceMessageParameters = "(QString,QString,QString)";
64 else if (_usedSourceParameters == 2)
65 _sourceMessageParameters = "(QString,QString,QString,QString)";
66 else if (_usedSourceParameters == 3)
67 _sourceMessageParameters = "(QString,QString,QString,QString,QString)";
58} 68}
59 69
@@ -73,5 +83,5 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa
73 83
74 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 84 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1());
75 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param3(%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());
76 86
77 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 87 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
@@ -86,4 +96,5 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa
86 e << param1 << param2 << param3; 96 e << param1 << param2 << param3;
87 97
98 qApp->processEvents();
88 99
89 return true; 100 return true;
@@ -109,22 +120,25 @@ void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
109bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 120bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
110{ 121{
111/*US 122
112 // copied from old mail2 123 // copied from old mail2
124/*
113 static int ii = 0; 125 static int ii = 0;
114 126
115 // block second call 127 // block second call
116 if ( ii < 2 ) { 128 if ( ii < 2 ) {
117 ++ii; 129 ++ii;
118 if ( ii > 1 ) { 130 if ( ii > 1 ) {
119 qDebug("qcop call blocked "); 131 qDebug("qcop call blocked ");
120 return true; 132 return true;
133 }
121 } 134 }
122 }
123*/ 135*/
124 qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); 136
137// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() );
125 138
126 //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
127 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data()) 140 if ( (_sourceMessage + _sourceMessageParameters) == cmsg.data())
128 { 141 {
142
129 QDataStream stream( data, IO_ReadOnly ); 143 QDataStream stream( data, IO_ReadOnly );
130 144
@@ -192,4 +206,6 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt
192 e << uid << nameEmailMap; 206 e << uid << nameEmailMap;
193 207
208 qApp->processEvents();
209
194 return true; 210 return true;
195 211
@@ -211,5 +227,5 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da
211 QDataStream stream( data, IO_ReadOnly ); 227 QDataStream stream( data, IO_ReadOnly );
212 228
213 qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); 229// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() );
214 230
215 //we are in the source and get an answer from the target 231 //we are in the source and get an answer from the target
@@ -259,4 +275,6 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString
259 e << uid << list1 << list2 << list3; 275 e << uid << list1 << list2 << list3;
260 276
277 qApp->processEvents();
278
261 return true; 279 return true;
262 280
@@ -278,5 +296,5 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d
278 QDataStream stream( data, IO_ReadOnly ); 296 QDataStream stream( data, IO_ReadOnly );
279 297
280 qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
281 299
282 //we are in the source and get an answer from the target 300 //we are in the source and get an answer from the target
@@ -323,5 +341,5 @@ ExternalAppHandler::ExternalAppHandler()
323 341
324 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); 342 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
325 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 343 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
326} 344}
327 345
@@ -987,8 +1005,8 @@ bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel,
987} 1005}
988 1006
989bool ExternalAppHandler::requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 1007bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid)
990{ 1008{
991 mDisplayDetails->setSourceChannel(sourceChannel); 1009 mDisplayDetails->setSourceChannel("");
992 return mDisplayDetails->sendMessageToTarget(sessionuid, name, email, uid); 1010 return mDisplayDetails->sendMessageToTarget("", name, email, uid);
993} 1011}
994 1012