Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/externalapphandler.cpp | 52 |
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 @@ -36,3 +36,6 @@ $Id$ #ifndef DESKTOP_VERSION +#include <qpe/qpeapplication.h> #include <qtopia/qcopenvelope_qws.h> +#else +#include <qapplication.h> #endif @@ -56,3 +59,10 @@ QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sour //sourceMessage passes later three parameters: sourceChannel, uid, param1 - _sourceMessageParameters = "(QString,QString,QString)"; + if (_usedSourceParameters == 0) + _sourceMessageParameters = "(QString,QString)"; + else if (_usedSourceParameters == 1) + _sourceMessageParameters = "(QString,QString,QString)"; + else if (_usedSourceParameters == 2) + _sourceMessageParameters = "(QString,QString,QString,QString)"; + else if (_usedSourceParameters == 3) + _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; } @@ -74,3 +84,3 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); - 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()); + 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()); @@ -87,2 +97,3 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa + qApp->processEvents(); @@ -110,16 +121,18 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data { -/*US + // copied from old mail2 +/* static int ii = 0; - // block second call - if ( ii < 2 ) { - ++ii; - if ( ii > 1 ) { - qDebug("qcop call blocked "); - return true; + // block second call + if ( ii < 2 ) { + ++ii; + if ( ii > 1 ) { + qDebug("qcop call blocked "); + return true; + } } - } */ - qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); + +// qDebug("QCopTransferItem- QCOP message received: %s ", cmsg.data() ); @@ -128,2 +141,3 @@ bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data { + QDataStream stream( data, IO_ReadOnly ); @@ -193,2 +207,4 @@ bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QSt + qApp->processEvents(); + return true; @@ -212,3 +228,3 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da - qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); +// qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); @@ -260,2 +276,4 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString + qApp->processEvents(); + return true; @@ -279,3 +297,3 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d - qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); +// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); @@ -324,3 +342,3 @@ ExternalAppHandler::ExternalAppHandler() mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); - 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&))); + 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&))); } @@ -988,6 +1006,6 @@ bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, -bool ExternalAppHandler::requestDetailsFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) +bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) { - mDisplayDetails->setSourceChannel(sourceChannel); - return mDisplayDetails->sendMessageToTarget(sessionuid, name, email, uid); + mDisplayDetails->setSourceChannel(""); + return mDisplayDetails->sendMessageToTarget("", name, email, uid); } |