Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewer.cpp | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 1f69700..0866939 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -51,7 +51,11 @@ #define size count #endif -#ifndef DESKTOP_VERSION + +#ifdef DESKTOP_VERSION +#include <kabc/addresseedialog.h> +#else //DESKTOP_VERSION +#include <externalapphandler.h> #include <qtopia/qcopenvelope_qws.h> -#endif +#endif //DESKTOP_VERSION KOEventViewer::KOEventViewer(QWidget *parent,const char *name) @@ -69,14 +73,13 @@ void KOEventViewer::setSource(const QString& n) { - if ( n.left(3) == "uid" ) { + if ( n.left(3) == "uid" ) +#ifdef DESKTOP_VERSION + { KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); KABC::AddressBook::Iterator it; for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { // LR I do not understand, why the uid string is different on zaurus and desktop -#ifdef DESKTOP_VERSION QString uid = "uid://"+(*it).uid(); -#else - QString uid = "uid:"+(*it).uid(); -#endif + //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); if (n == uid ) { @@ -100,8 +103,26 @@ void KOEventViewer::setSource(const QString& n) return; } +#else + { + QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + if (attendees.count()) { + Attendee *a; + for(a=attendees.first();a;a=attendees.next()) { + if ( "uid:"+a->uid() == n ) { + bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), ""); + return; + } + } + } + return; + } + //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); + // the result should now arrive through method insertAttendees + //QString uid = "uid:"+(*it).uid(); +#endif if ( n.left(6) == "mailto" ) { // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); #ifndef DESKTOP_VERSION - QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)" ); + QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); e << n.mid(7); #endif @@ -384,4 +405,5 @@ void KOEventViewer::formatAttendees(Incidence *event) #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION KABC::AddressBook *add_book = KABC::StdAddressBook::self(); KABC::Addressee::List addressList; @@ -395,4 +417,9 @@ void KOEventViewer::formatAttendees(Incidence *event) mText.append(event->organizer()); } +#else //DESKTOP_VERSION + mText.append(event->organizer()); +#endif //DESKTOP_VERSION + + #else mText.append(event->organizer()); @@ -411,4 +438,5 @@ void KOEventViewer::formatAttendees(Incidence *event) for(a=attendees.first();a;a=attendees.next()) { #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION if (a->name().isEmpty()) { addressList = add_book->findByEmail(a->email()); @@ -429,4 +457,10 @@ void KOEventViewer::formatAttendees(Incidence *event) mText += "</a>\n"; } +#else //DESKTOP_VERSION + mText += "<li><a href=\"uid:" + a->uid() + "\">"; + if (!a->name().isEmpty()) mText += a->name(); + else mText += a->email(); + mText += "</a>\n"; +#endif //DESKTOP_VERSION #else //qDebug("nokabc "); |