-rw-r--r-- | korganizer/koeditordetails.cpp | 35 | ||||
-rw-r--r-- | korganizer/koeditordetails.h | 5 |
2 files changed, 40 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 @@ -38,5 +38,11 @@ #include <kmessagebox.h> #ifndef KORG_NOKABC + +#ifdef DESKTOP_VERSION #include <kabc/addresseedialog.h> +#else //DESKTOP_VERSION +#include <externalapphandler.h> +#endif //DESKTOP_VERSION + #endif @@ -196,4 +202,9 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 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&))); + } @@ -222,4 +233,5 @@ void KOEditorDetails::openAddressBook() #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); uint i=0; @@ -227,4 +239,9 @@ void KOEditorDetails::openAddressBook() 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 @@ -264,4 +281,22 @@ void KOEditorDetails::addNewAttendee() } +//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) diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h index 930b296..0cc807f 100644 --- a/korganizer/koeditordetails.h +++ b/korganizer/koeditordetails.h @@ -24,4 +24,5 @@ #define _KOEDITORDETAILS_H +#include <qmap.h> #include <qframe.h> #include <qlabel.h> @@ -71,4 +72,8 @@ class KOEditorDetails : public QWidget public slots: void insertAttendee(Attendee *); + // called when the app recieves a list of name/email/uid (=addresses) from another app. Usually Ka/Pi + // The first parameter is a uniqueid. It can be used to identify if event + void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); + protected slots: |