-rw-r--r-- | libkdepim/externalapphandler.cpp | 36 | ||||
-rw-r--r-- | libkdepim/externalapphandler.h | 10 |
2 files changed, 32 insertions, 14 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index b57506b..bd83626 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -34,7 +34,10 @@ $Id$ | |||
34 | #include <qregexp.h> | 34 | #include <qregexp.h> |
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 | ||
40 | #include <kstaticdeleter.h> | 43 | #include <kstaticdeleter.h> |
@@ -54,7 +57,14 @@ QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sour | |||
54 | : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) | 57 | : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) |
55 | { | 58 | { |
56 | //sourceMessage passes later three parameters: sourceChannel, uid, param1 | 59 | //sourceMessage passes later three parameters: sourceChannel, uid, param1 |
60 | if (_usedSourceParameters == 0) | ||
61 | _sourceMessageParameters = "(QString,QString)"; | ||
62 | else if (_usedSourceParameters == 1) | ||
57 | _sourceMessageParameters = "(QString,QString,QString)"; | 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 | ||
60 | /*********************************************************************************/ | 70 | /*********************************************************************************/ |
@@ -72,7 +82,7 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa | |||
72 | QString sourceMessage = _sourceMessage + _sourceMessageParameters; | 82 | QString sourceMessage = _sourceMessage + _sourceMessageParameters; |
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()); |
78 | 88 | ||
@@ -85,6 +95,7 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa | |||
85 | else if (_usedSourceParameters == 3) | 95 | else if (_usedSourceParameters == 3) |
86 | e << param1 << param2 << param3; | 96 | e << param1 << param2 << param3; |
87 | 97 | ||
98 | qApp->processEvents(); | ||
88 | 99 | ||
89 | return true; | 100 | return true; |
90 | 101 | ||
@@ -108,8 +119,9 @@ void QCopTransferItem::setSourceChannel(const QString& sourceChannel) | |||
108 | /*********************************************************************************/ | 119 | /*********************************************************************************/ |
109 | bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) | 120 | bool 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 |
@@ -121,11 +133,13 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data | |||
121 | } | 133 | } |
122 | } | 134 | } |
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 | ||
131 | 145 | ||
@@ -191,6 +205,8 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt | |||
191 | 205 | ||
192 | e << uid << nameEmailMap; | 206 | e << uid << nameEmailMap; |
193 | 207 | ||
208 | qApp->processEvents(); | ||
209 | |||
194 | return true; | 210 | return true; |
195 | 211 | ||
196 | #else | 212 | #else |
@@ -210,7 +226,7 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da | |||
210 | { | 226 | { |
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 |
216 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) | 232 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) |
@@ -258,6 +274,8 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString | |||
258 | 274 | ||
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 | ||
263 | #else | 281 | #else |
@@ -277,7 +295,7 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d | |||
277 | { | 295 | { |
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 |
283 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) | 301 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) |
@@ -322,7 +340,7 @@ ExternalAppHandler::ExternalAppHandler() | |||
322 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 340 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
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 | ||
328 | ExternalAppHandler::~ExternalAppHandler() | 346 | ExternalAppHandler::~ExternalAppHandler() |
@@ -986,10 +1004,10 @@ bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, | |||
986 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); | 1004 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); |
987 | } | 1005 | } |
988 | 1006 | ||
989 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | 1007 | bool 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 | ||
995 | 1013 | ||
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index a74080f..1b04b2b 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h | |||
@@ -198,14 +198,14 @@ class ExternalAppHandler : public QObject | |||
198 | 198 | ||
199 | 199 | ||
200 | //Call this method on the source when you want to select names from the addressbook by using QCop | 200 | //Call this method on the source when you want to select names from the addressbook by using QCop |
201 | bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid); | 201 | bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid); |
202 | //Call this method on the target when you want to return the name/email map to the source (client). | 202 | //Call this method on the target when you want to return the name/email map to the source (client). |
203 | bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid); | 203 | bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); |
204 | 204 | ||
205 | bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QString& email); | 205 | bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email); |
206 | bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& uid, const QStringList& name, const QStringList& email, const QStringList& uid); | 206 | bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); |
207 | 207 | ||
208 | bool requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 208 | bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid); |
209 | 209 | ||
210 | 210 | ||
211 | //loadConfig clears the cache and checks again if the applications are available or not | 211 | //loadConfig clears the cache and checks again if the applications are available or not |