author | zautrix <zautrix> | 2004-09-07 20:33:23 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-07 20:33:23 (UTC) |
commit | 64a8ef1629f523df3006de5cb2b9882a50d96a05 (patch) (unidiff) | |
tree | b931dc5397b4eec926603080b20eddda131999ff /korganizer | |
parent | 9d5c8750ae671e73ec8ebc0a71f30fd30680f2c0 (diff) | |
download | kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.zip kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.gz kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.bz2 |
Fixed Kopi-Kapi external app communication
-rw-r--r-- | korganizer/koeventviewer.cpp | 50 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
2 files changed, 44 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 @@ | |||
50 | #include <kabc/stdaddressbook.h> | 50 | #include <kabc/stdaddressbook.h> |
51 | #define size count | 51 | #define size count |
52 | #endif | 52 | #endif |
53 | #ifndef DESKTOP_VERSION | 53 | |
54 | #ifdef DESKTOP_VERSION | ||
55 | #include <kabc/addresseedialog.h> | ||
56 | #else //DESKTOP_VERSION | ||
57 | #include <externalapphandler.h> | ||
54 | #include <qtopia/qcopenvelope_qws.h> | 58 | #include <qtopia/qcopenvelope_qws.h> |
55 | #endif | 59 | #endif //DESKTOP_VERSION |
56 | 60 | ||
57 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) | 61 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) |
58 | : QTextBrowser(parent,name) | 62 | : QTextBrowser(parent,name) |
@@ -68,16 +72,15 @@ KOEventViewer::~KOEventViewer() | |||
68 | void KOEventViewer::setSource(const QString& n) | 72 | void KOEventViewer::setSource(const QString& n) |
69 | { | 73 | { |
70 | 74 | ||
71 | if ( n.left(3) == "uid" ) { | 75 | if ( n.left(3) == "uid" ) |
76 | #ifdef DESKTOP_VERSION | ||
77 | { | ||
72 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 78 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
73 | KABC::AddressBook::Iterator it; | 79 | KABC::AddressBook::Iterator it; |
74 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 80 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
75 | // LR I do not understand, why the uid string is different on zaurus and desktop | 81 | // LR I do not understand, why the uid string is different on zaurus and desktop |
76 | #ifdef DESKTOP_VERSION | ||
77 | QString uid = "uid://"+(*it).uid(); | 82 | QString uid = "uid://"+(*it).uid(); |
78 | #else | 83 | |
79 | QString uid = "uid:"+(*it).uid(); | ||
80 | #endif | ||
81 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 84 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
82 | if (n == uid ) { | 85 | if (n == uid ) { |
83 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 86 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
@@ -99,10 +102,28 @@ void KOEventViewer::setSource(const QString& n) | |||
99 | } | 102 | } |
100 | return; | 103 | return; |
101 | } | 104 | } |
105 | #else | ||
106 | { | ||
107 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | ||
108 | if (attendees.count()) { | ||
109 | Attendee *a; | ||
110 | for(a=attendees.first();a;a=attendees.next()) { | ||
111 | if ( "uid:"+a->uid() == n ) { | ||
112 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), ""); | ||
113 | return; | ||
114 | } | ||
115 | } | ||
116 | } | ||
117 | return; | ||
118 | } | ||
119 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | ||
120 | // the result should now arrive through method insertAttendees | ||
121 | //QString uid = "uid:"+(*it).uid(); | ||
122 | #endif | ||
102 | if ( n.left(6) == "mailto" ) { | 123 | if ( n.left(6) == "mailto" ) { |
103 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 124 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
104 | #ifndef DESKTOP_VERSION | 125 | #ifndef DESKTOP_VERSION |
105 | QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)" ); | 126 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
106 | e << n.mid(7); | 127 | e << n.mid(7); |
107 | #endif | 128 | #endif |
108 | 129 | ||
@@ -383,6 +404,7 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
383 | mText.append("<ul><li>"); | 404 | mText.append("<ul><li>"); |
384 | #ifndef KORG_NOKABC | 405 | #ifndef KORG_NOKABC |
385 | 406 | ||
407 | #ifdef DESKTOP_VERSION | ||
386 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 408 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
387 | KABC::Addressee::List addressList; | 409 | KABC::Addressee::List addressList; |
388 | addressList = add_book->findByEmail(event->organizer()); | 410 | addressList = add_book->findByEmail(event->organizer()); |
@@ -394,6 +416,11 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
394 | } else { | 416 | } else { |
395 | mText.append(event->organizer()); | 417 | mText.append(event->organizer()); |
396 | } | 418 | } |
419 | #else //DESKTOP_VERSION | ||
420 | mText.append(event->organizer()); | ||
421 | #endif //DESKTOP_VERSION | ||
422 | |||
423 | |||
397 | #else | 424 | #else |
398 | mText.append(event->organizer()); | 425 | mText.append(event->organizer()); |
399 | #endif | 426 | #endif |
@@ -410,6 +437,7 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
410 | mText.append("<ul>"); | 437 | mText.append("<ul>"); |
411 | for(a=attendees.first();a;a=attendees.next()) { | 438 | for(a=attendees.first();a;a=attendees.next()) { |
412 | #ifndef KORG_NOKABC | 439 | #ifndef KORG_NOKABC |
440 | #ifdef DESKTOP_VERSION | ||
413 | if (a->name().isEmpty()) { | 441 | if (a->name().isEmpty()) { |
414 | addressList = add_book->findByEmail(a->email()); | 442 | addressList = add_book->findByEmail(a->email()); |
415 | KABC::Addressee o = addressList.first(); | 443 | KABC::Addressee o = addressList.first(); |
@@ -428,6 +456,12 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
428 | else mText += a->email(); | 456 | else mText += a->email(); |
429 | mText += "</a>\n"; | 457 | mText += "</a>\n"; |
430 | } | 458 | } |
459 | #else //DESKTOP_VERSION | ||
460 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | ||
461 | if (!a->name().isEmpty()) mText += a->name(); | ||
462 | else mText += a->email(); | ||
463 | mText += "</a>\n"; | ||
464 | #endif //DESKTOP_VERSION | ||
431 | #else | 465 | #else |
432 | //qDebug("nokabc "); | 466 | //qDebug("nokabc "); |
433 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 467 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d4fadcb..7978b46 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -202,7 +202,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
202 | } | 202 | } |
203 | 203 | ||
204 | //US listen for result adressed from Ka/Pi | 204 | //US listen for result adressed from Ka/Pi |
205 | #ifndef DESKTOP_VERSION | ||
205 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 206 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
207 | #endif | ||
206 | } | 208 | } |
207 | MainWindow::~MainWindow() | 209 | MainWindow::~MainWindow() |
208 | { | 210 | { |