Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditordetails.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index c0e7bdd..8e2fabe 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp @@ -34,13 +34,19 @@ #include <klocale.h> #include <kglobal.h> #include <kiconloader.h> #include <kstandarddirs.h> #include <kmessagebox.h> #ifndef KORG_NOKABC + +#ifdef DESKTOP_VERSION #include <kabc/addresseedialog.h> +#else //DESKTOP_VERSION +#include <externalapphandler.h> +#endif //DESKTOP_VERSION + #endif #include <libkcal/incidence.h> #include "koprefs.h" @@ -192,12 +198,17 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) #ifdef KORG_NOKABC mAddressBookButton->hide(); #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() { } @@ -218,17 +229,23 @@ void KOEditorDetails::removeAttendee() 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()) { insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); } @@ -260,12 +277,30 @@ void KOEditorDetails::addNewAttendee() #endif Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); 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) { AttendeeListItem *item = new AttendeeListItem(a,mListView); mListView->setSelected( item, true ); } |