summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditordetails.cpp
authorulf69 <ulf69>2004-08-17 00:15:05 (UTC)
committer ulf69 <ulf69>2004-08-17 00:15:05 (UTC)
commit7d15927b7e7957a80da335587598e7b62dece1a4 (patch) (unidiff)
tree607b15062fa09b278c764afbc221736a68dbd2c8 /korganizer/koeditordetails.cpp
parentf3875aba68f175e8da32462f64b12fc46bc31102 (diff)
downloadkdepimpi-7d15927b7e7957a80da335587598e7b62dece1a4.zip
kdepimpi-7d15927b7e7957a80da335587598e7b62dece1a4.tar.gz
kdepimpi-7d15927b7e7957a80da335587598e7b62dece1a4.tar.bz2
added listener to access Ka/pi via QCop
Diffstat (limited to 'korganizer/koeditordetails.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditordetails.cpp39
1 files changed, 37 insertions, 2 deletions
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 @@
37#include <kstandarddirs.h> 37#include <kstandarddirs.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#ifndef KORG_NOKABC 39#ifndef KORG_NOKABC
40
41#ifdef DESKTOP_VERSION
40#include <kabc/addresseedialog.h> 42#include <kabc/addresseedialog.h>
43#else //DESKTOP_VERSION
44#include <externalapphandler.h>
45#endif //DESKTOP_VERSION
46
41#endif 47#endif
42 48
43#include <libkcal/incidence.h> 49#include <libkcal/incidence.h>
@@ -84,7 +90,7 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
84 if ( KOPrefs::instance()->mCompactDialogs ) { 90 if ( KOPrefs::instance()->mCompactDialogs ) {
85 //mListView->setFixedHeight(78); 91 //mListView->setFixedHeight(78);
86 } 92 }
87 93
88 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 94 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
89 SLOT(updateAttendeeInput())); 95 SLOT(updateAttendeeInput()));
90 96
@@ -195,6 +201,11 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
195#endif 201#endif
196 202
197 updateAttendeeInput(); 203 updateAttendeeInput();
204
205//US listen for arriving address resultsets
206 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
207 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
208
198} 209}
199 210
200KOEditorDetails::~KOEditorDetails() 211KOEditorDetails::~KOEditorDetails()
@@ -221,12 +232,18 @@ void KOEditorDetails::openAddressBook()
221{ 232{
222#ifndef KORG_NOKABC 233#ifndef KORG_NOKABC
223 234
235#ifdef DESKTOP_VERSION
224 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 236 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
225 uint i=0; 237 uint i=0;
226 for (i=0; i < list.count(); i++) { 238 for (i=0; i < list.count(); i++) {
227 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); 239 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) );
228 } 240 }
229 241#else
242 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
243 // the result should now arrive through method insertAttendees
244#endif
245
246
230#if 0 247#if 0
231 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); 248 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
232 if (!a.isEmpty()) { 249 if (!a.isEmpty()) {
@@ -263,6 +280,24 @@ void KOEditorDetails::addNewAttendee()
263 insertAttendee(a); 280 insertAttendee(a);
264} 281}
265 282
283//the map includes name/email pairs, that comes from Ka/Pi
284void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
285{
286 if (uid == this->name())
287 {
288 for ( int i = 0; i < nameList.count(); i++)
289 {
290 QString _name = nameList[i];
291 QString _email = emailList[i];
292 QString _uid = uidList[i];
293
294 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid);
295 insertAttendee(a);
296 }
297 }
298
299}
300
266 301
267void KOEditorDetails::insertAttendee(Attendee *a) 302void KOEditorDetails::insertAttendee(Attendee *a)
268{ 303{