summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp68
1 files changed, 58 insertions, 10 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 99aee86..07bdff2 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -255,25 +255,29 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da
QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage)
: QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage)
{
//targetMessage returns later two parameters: uid, and three lists
- _targetMessageParameters = "(QString,QStringList,QStringList,QStringList)";
+ _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)";
}
/*********************************************************************************/
-bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
+bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6)
{
#ifndef DESKTOP_VERSION
//targetMessage passes two parameters: uid, map
QString targetMessage = _targetMessage + _targetMessageParameters;
qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
- qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1());
+ qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1());
+
+
+ for ( int i = 0; i < list3.count(); i++)
+ qDebug("listentry list3: %s",list3[i].latin1());
QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
//US we need no names in the To field. The emailadresses are enough
- e << uid << list1 << list2 << list3;
+ e << uid << list1 << list2 << list3 << list4 << list5 << list6;
qApp->processEvents();
return true;
@@ -303,12 +307,17 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d
{
QStringList list1;
QStringList list2;
QStringList list3;
+ QStringList list4;
+ QStringList list5;
+ QStringList list6;
QString uid;
- stream >> uid >> list1 >> list2 >> list3;
- emit receivedMessageFromTarget(uid, list1, list2, list3);
+ qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
+
+ stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6;
+ emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6);
return true;
}
@@ -332,22 +341,43 @@ ExternalAppHandler::ExternalAppHandler()
mDefaultItems.setAutoDelete(true);
mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList");
connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&)));
- connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
+ connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList");
//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&)));
//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
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&)));
+
+
+
+ mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList");
+ connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&)));
+ connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
+
+
}
ExternalAppHandler::~ExternalAppHandler()
{
}
+void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid,
+ const QStringList& nameList,
+ const QStringList& emailList,
+ const QStringList& uidList,
+ const QStringList&,
+ const QStringList&,
+ const QStringList& )
+{
+ // this method is a conevnient way to reduce the number of parameters I have to pass
+ emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList);
+}
+
+
void ExternalAppHandler::loadConfig()
{
mDefaultItems.clear();
@@ -1048,8 +1078,11 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
{
bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
if (!res)
+ res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data );
+
+ if (!res)
res = mDisplayDetails->appMessage( cmsg, data );
// if (!res)
// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
@@ -1064,11 +1097,12 @@ bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceCh
}
bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
{
-
+ QStringList list4, list5, list6;
+
mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
- return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
+ return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6);
}
bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email)
{
@@ -1077,18 +1111,32 @@ bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel
}
bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
{
+ QStringList list4, list5, list6;
+
mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
- return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
+ return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6);
}
bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid)
{
mDisplayDetails->setSourceChannel("");
return mDisplayDetails->sendMessageToTarget("", name, email, uid);
}
+bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
+{
+ mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel);
+ return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid);
+}
+
+bool ExternalAppHandler::returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6)
+{
+ mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel);
+ return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6);
+}
+