From 7d15927b7e7957a80da335587598e7b62dece1a4 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Tue, 17 Aug 2004 00:15:05 +0000 Subject: added listener to access Ka/pi via QCop --- (limited to 'korganizer/koeditordetails.cpp') diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index c0e7bdd..8e2fabe 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp @@ -37,7 +37,13 @@ #include #include #ifndef KORG_NOKABC + +#ifdef DESKTOP_VERSION #include +#else //DESKTOP_VERSION +#include +#endif //DESKTOP_VERSION + #endif #include @@ -84,7 +90,7 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) if ( KOPrefs::instance()->mCompactDialogs ) { //mListView->setFixedHeight(78); } - + connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), SLOT(updateAttendeeInput())); @@ -195,6 +201,11 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) #endif updateAttendeeInput(); + +//US listen for arriving address resultsets + connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), + this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); + } KOEditorDetails::~KOEditorDetails() @@ -221,12 +232,18 @@ void KOEditorDetails::openAddressBook() { #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); uint i=0; for (i=0; i < list.count(); i++) { insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); } - +#else + bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); + // the result should now arrive through method insertAttendees +#endif + + #if 0 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); if (!a.isEmpty()) { @@ -263,6 +280,24 @@ void KOEditorDetails::addNewAttendee() insertAttendee(a); } +//the map includes name/email pairs, that comes from Ka/Pi +void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) +{ + if (uid == this->name()) + { + for ( int i = 0; i < nameList.count(); i++) + { + QString _name = nameList[i]; + QString _email = emailList[i]; + QString _uid = uidList[i]; + + Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); + insertAttendee(a); + } + } + +} + void KOEditorDetails::insertAttendee(Attendee *a) { -- cgit v0.9.0.2