summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
authorzautrix <zautrix>2004-09-07 20:33:23 (UTC)
committer zautrix <zautrix>2004-09-07 20:33:23 (UTC)
commit64a8ef1629f523df3006de5cb2b9882a50d96a05 (patch) (side-by-side diff)
treeb931dc5397b4eec926603080b20eddda131999ff /korganizer/koeventviewer.cpp
parent9d5c8750ae671e73ec8ebc0a71f30fd30680f2c0 (diff)
downloadkdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.zip
kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.gz
kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.bz2
Fixed Kopi-Kapi external app communication
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp50
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
@@ -50,9 +50,13 @@
#include <kabc/stdaddressbook.h>
#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)
: QTextBrowser(parent,name)
@@ -68,16 +72,15 @@ KOEventViewer::~KOEventViewer()
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 ) {
//qDebug("found %s ",(*it).mobileHomePhone().latin1() );
@@ -99,10 +102,28 @@ 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
@@ -383,6 +404,7 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText.append("<ul><li>");
#ifndef KORG_NOKABC
+#ifdef DESKTOP_VERSION
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
KABC::Addressee::List addressList;
addressList = add_book->findByEmail(event->organizer());
@@ -394,6 +416,11 @@ void KOEventViewer::formatAttendees(Incidence *event)
} else {
mText.append(event->organizer());
}
+#else //DESKTOP_VERSION
+ mText.append(event->organizer());
+#endif //DESKTOP_VERSION
+
+
#else
mText.append(event->organizer());
#endif
@@ -410,6 +437,7 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText.append("<ul>");
for(a=attendees.first();a;a=attendees.next()) {
#ifndef KORG_NOKABC
+#ifdef DESKTOP_VERSION
if (a->name().isEmpty()) {
addressList = add_book->findByEmail(a->email());
KABC::Addressee o = addressList.first();
@@ -428,6 +456,12 @@ void KOEventViewer::formatAttendees(Incidence *event)
else mText += a->email();
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 ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";