summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-07 20:33:23 (UTC)
committer zautrix <zautrix>2004-09-07 20:33:23 (UTC)
commit64a8ef1629f523df3006de5cb2b9882a50d96a05 (patch) (unidiff)
treeb931dc5397b4eec926603080b20eddda131999ff
parent9d5c8750ae671e73ec8ebc0a71f30fd30680f2c0 (diff)
downloadkdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.zip
kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.gz
kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.bz2
Fixed Kopi-Kapi external app communication
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp2
-rw-r--r--kabc/stdaddressbook.cpp14
-rw-r--r--kaddressbook/kabcore.cpp19
-rw-r--r--korganizer/koeventviewer.cpp50
-rw-r--r--korganizer/mainwindow.cpp2
-rw-r--r--libkdepim/externalapphandler.cpp2
6 files changed, 68 insertions, 21 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index c61b387..47d298a 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -406,49 +406,49 @@ AddressBook::Iterator AddressBook::find( const Addressee &a )
406} 406}
407 407
408Addressee AddressBook::findByUid( const QString &uid ) 408Addressee AddressBook::findByUid( const QString &uid )
409{ 409{
410 Iterator it; 410 Iterator it;
411 for ( it = begin(); it != end(); ++it ) { 411 for ( it = begin(); it != end(); ++it ) {
412 if ( uid == (*it).uid() ) { 412 if ( uid == (*it).uid() ) {
413 return *it; 413 return *it;
414 } 414 }
415 } 415 }
416 return Addressee(); 416 return Addressee();
417} 417}
418 418
419Addressee::List AddressBook::allAddressees() 419Addressee::List AddressBook::allAddressees()
420{ 420{
421 return d->mAddressees; 421 return d->mAddressees;
422} 422}
423 423
424Addressee::List AddressBook::findByName( const QString &name ) 424Addressee::List AddressBook::findByName( const QString &name )
425{ 425{
426 Addressee::List results; 426 Addressee::List results;
427 427
428 Iterator it; 428 Iterator it;
429 for ( it = begin(); it != end(); ++it ) { 429 for ( it = begin(); it != end(); ++it ) {
430 if ( name == (*it).name() ) { 430 if ( name == (*it).realName() ) {
431 results.append( *it ); 431 results.append( *it );
432 } 432 }
433 } 433 }
434 434
435 return results; 435 return results;
436} 436}
437 437
438Addressee::List AddressBook::findByEmail( const QString &email ) 438Addressee::List AddressBook::findByEmail( const QString &email )
439{ 439{
440 Addressee::List results; 440 Addressee::List results;
441 QStringList mailList; 441 QStringList mailList;
442 442
443 Iterator it; 443 Iterator it;
444 for ( it = begin(); it != end(); ++it ) { 444 for ( it = begin(); it != end(); ++it ) {
445 mailList = (*it).emails(); 445 mailList = (*it).emails();
446 for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { 446 for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) {
447 if ( email == (*ite) ) { 447 if ( email == (*ite) ) {
448 results.append( *it ); 448 results.append( *it );
449 } 449 }
450 } 450 }
451 } 451 }
452 452
453 return results; 453 return results;
454} 454}
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp
index 760820e..9f38f08 100644
--- a/kabc/stdaddressbook.cpp
+++ b/kabc/stdaddressbook.cpp
@@ -42,85 +42,95 @@ bool StdAddressBook::mAutomaticSave = true;
42 42
43static KStaticDeleter<StdAddressBook> addressBookDeleter; 43static KStaticDeleter<StdAddressBook> addressBookDeleter;
44 44
45QString StdAddressBook::fileName() 45QString StdAddressBook::fileName()
46{ 46{
47 return locateLocal( "data", "kabc/std.vcf" ); 47 return locateLocal( "data", "kabc/std.vcf" );
48} 48}
49 49
50QString StdAddressBook::directoryName() 50QString StdAddressBook::directoryName()
51{ 51{
52 return locateLocal( "data", "kabc/stdvcf" ); 52 return locateLocal( "data", "kabc/stdvcf" );
53} 53}
54 54
55void StdAddressBook::handleCrash() 55void StdAddressBook::handleCrash()
56{ 56{
57 StdAddressBook::self()->cleanUp(); 57 StdAddressBook::self()->cleanUp();
58} 58}
59 59
60StdAddressBook *StdAddressBook::self() 60StdAddressBook *StdAddressBook::self()
61{ 61{
62 62
63 if ( !mSelf ) 63 if ( !mSelf )
64 { 64 {
65 QString appdir = StdAddressBook::setTempAppDir(); 65 QString appdir = StdAddressBook::setTempAppDir();
66 66 qDebug("****************************************************** ");
67 kdDebug(5700) << "StdAddressBook::self()" << endl; 67 qDebug("****************************************************** ");
68 qDebug("****************************************************** ");
69 qDebug("****************************************************** ");
70 qDebug("****************************************************** ");
68// US im am not sure why I have to use the other format here?? 71// US im am not sure why I have to use the other format here??
69#ifdef KAB_EMBEDDED 72#ifdef KAB_EMBEDDED
70 mSelf = addressBookDeleter.setObject( new StdAddressBook ); 73 mSelf = addressBookDeleter.setObject( new StdAddressBook );
71#else //KAB_EMBEDDED 74#else //KAB_EMBEDDED
72 addressBookDeleter.setObject( mSelf, new StdAddressBook ); 75 addressBookDeleter.setObject( mSelf, new StdAddressBook );
73#endif //KAB_EMBEDDED 76#endif //KAB_EMBEDDED
74 KStandardDirs::setAppDir( appdir ); 77 KStandardDirs::setAppDir( appdir );
75 } 78 }
76 79
77 return mSelf; 80 return mSelf;
78} 81}
79 82
80QString StdAddressBook::setTempAppDir() 83QString StdAddressBook::setTempAppDir()
81{ 84{
82 QString appDIR = KStandardDirs::appDir(); 85 QString appDIR = KStandardDirs::appDir();
83#ifdef DESKTOP_VERSION 86#ifdef DESKTOP_VERSION
84 QString appdir = QDir::homeDirPath(); 87 QString appdir = QDir::homeDirPath();
85 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) 88 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
86 appdir += "kaddressbook/"; 89 appdir += "kaddressbook/";
87 else 90 else
88 appdir += "/kaddressbook/"; 91 appdir += "/kaddressbook/";
89 KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); 92 KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
90#else 93#else
91 QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; 94 QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook";
92 95
93 KStandardDirs::setAppDir( appdir ); 96 KStandardDirs::setAppDir( appdir );
94#endif 97#endif
95 98
96 return appDIR; 99 return appDIR;
97} 100}
98StdAddressBook *StdAddressBook::self( bool onlyFastResources ) 101StdAddressBook *StdAddressBook::self( bool onlyFastResources )
99{ 102{
100 103
101 if ( !mSelf ) 104 if ( !mSelf )
102 { 105 {
106 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
107 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
108 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
109 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
110 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
111 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
112 qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ ");
103 QString appdir =StdAddressBook::setTempAppDir(); 113 QString appdir =StdAddressBook::setTempAppDir();
104#ifdef KAB_EMBEDDED 114#ifdef KAB_EMBEDDED
105 mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); 115 mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) );
106#else //KAB_EMBEDDED 116#else //KAB_EMBEDDED
107 addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); 117 addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) );
108#endif //KAB_EMBEDDED 118#endif //KAB_EMBEDDED
109 KStandardDirs::setAppDir( appdir ); 119 KStandardDirs::setAppDir( appdir );
110 } 120 }
111 return mSelf; 121 return mSelf;
112} 122}
113 123
114StdAddressBook::StdAddressBook() 124StdAddressBook::StdAddressBook()
115 : AddressBook( "kabcrc" ) 125 : AddressBook( "kabcrc" )
116{ 126{
117 127
118 init( false ); 128 init( false );
119} 129}
120 130
121StdAddressBook::StdAddressBook( bool onlyFastResources ) 131StdAddressBook::StdAddressBook( bool onlyFastResources )
122 : AddressBook( "kabcrc" ) 132 : AddressBook( "kabcrc" )
123{ 133{
124 134
125 init( onlyFastResources ); 135 init( onlyFastResources );
126} 136}
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 4299ebd..2f9f1df 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2020,97 +2020,100 @@ void KABCore::configureResources()
2020 */ 2020 */
2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2022{ 2022{
2023 QStringList nameList; 2023 QStringList nameList;
2024 QStringList emailList; 2024 QStringList emailList;
2025 QStringList uidList; 2025 QStringList uidList;
2026 2026
2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2028 uint i=0; 2028 uint i=0;
2029 for (i=0; i < list.count(); i++) 2029 for (i=0; i < list.count(); i++)
2030 { 2030 {
2031 nameList.append(list[i].realName()); 2031 nameList.append(list[i].realName());
2032 emailList.append(list[i].preferredEmail()); 2032 emailList.append(list[i].preferredEmail());
2033 uidList.append(list[i].uid()); 2033 uidList.append(list[i].uid());
2034 } 2034 }
2035 2035
2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2037 2037
2038} 2038}
2039 2039
2040/* this method will be called through the QCop interface from other apps to show details of a contact. 2040/* this method will be called through the QCop interface from other apps to show details of a contact.
2041 */ 2041 */
2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2043{ 2043{
2044// qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2044 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2045 2045
2046 QString foundUid = QString::null; 2046 QString foundUid = QString::null;
2047 if (uid.isEmpty()) 2047 if (uid.isEmpty())
2048 { 2048 {
2049 //find the uid of the person first 2049 //find the uid of the person first
2050 Addressee::List namelist; 2050 Addressee::List namelist;
2051 Addressee::List emaillist; 2051 Addressee::List emaillist;
2052 2052
2053 if (!name.isEmpty()) 2053 if (!name.isEmpty())
2054 namelist = mAddressBook->findByName( name ); 2054 namelist = mAddressBook->findByName( name );
2055 2055
2056 if (!email.isEmpty()) 2056 if (!email.isEmpty())
2057 emaillist = mAddressBook->findByEmail( email ); 2057 emaillist = mAddressBook->findByEmail( email );
2058 2058 qDebug("count %d %d ", namelist.count(),emaillist.count() );
2059 //check if we have a match in Namelist and Emaillist 2059 //check if we have a match in Namelist and Emaillist
2060 if ((namelist.count() == 0) && (emaillist.count() > 0)) 2060 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2061 foundUid == emaillist[0].uid(); 2061 foundUid = emaillist[0].uid();
2062 }
2062 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2063 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2063 foundUid == namelist[0].uid(); 2064 foundUid = namelist[0].uid();
2064 else 2065 else
2065 { 2066 {
2066 for (int i = 0; i < namelist.count(); i++) 2067 for (int i = 0; i < namelist.count(); i++)
2067 { 2068 {
2068 for (int j = 0; j < emaillist.count(); j++) 2069 for (int j = 0; j < emaillist.count(); j++)
2069 { 2070 {
2070 if (namelist[i] == emaillist[j]) 2071 if (namelist[i] == emaillist[j])
2071 { 2072 {
2072 foundUid == namelist[i].uid(); 2073 foundUid = namelist[i].uid();
2073 } 2074 }
2074 } 2075 }
2075 } 2076 }
2076 } 2077 }
2077 } 2078 }
2078 else 2079 else
2079 { 2080 {
2080 foundUid = uid; 2081 foundUid = uid;
2081 } 2082 }
2082 2083
2083 if (!foundUid.isEmpty()) 2084 if (!foundUid.isEmpty())
2084 { 2085 {
2086
2085 // raise Ka/Pi if it is in the background 2087 // raise Ka/Pi if it is in the background
2086#ifndef DESKTOP_VERSION 2088#ifndef DESKTOP_VERSION
2087#ifndef KORG_NODCOP 2089#ifndef KORG_NODCOP
2088 QCopEnvelope e("QPE/Application/kapi", "raise()"); 2090 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2089#endif 2091#endif
2090#endif 2092#endif
2091 2093
2092 mMainWindow->showMaximized(); 2094 mMainWindow->showMaximized();
2095 mMainWindow-> raise();
2093 2096
2094 mViewManager->setSelected( "", false); 2097 mViewManager->setSelected( "", false);
2095 mViewManager->refreshView( "" ); 2098 mViewManager->refreshView( "" );
2096 mViewManager->setSelected( foundUid, true ); 2099 mViewManager->setSelected( foundUid, true );
2097 mViewManager->refreshView( foundUid ); 2100 mViewManager->refreshView( foundUid );
2098 2101
2099 if ( !mMultipleViewsAtOnce ) 2102 if ( !mMultipleViewsAtOnce )
2100 { 2103 {
2101 setDetailsVisible( true ); 2104 setDetailsVisible( true );
2102 mActionDetails->setChecked(true); 2105 mActionDetails->setChecked(true);
2103 } 2106 }
2104 } 2107 }
2105} 2108}
2106 2109
2107 2110
2108void KABCore::faq() 2111void KABCore::faq()
2109{ 2112{
2110 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2113 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2111} 2114}
2112 2115
2113 2116
2114 2117
2115 2118
2116#ifndef KAB_EMBEDDED 2119#ifndef KAB_EMBEDDED
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 1f69700..0866939 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -29,101 +29,122 @@
29#include <libkcal/event.h> 29#include <libkcal/event.h>
30#include <libkcal/todo.h> 30#include <libkcal/todo.h>
31#include <kdebug.h> 31#include <kdebug.h>
32#include <kiconloader.h> 32#include <kiconloader.h>
33#include <krun.h> 33#include <krun.h>
34#include <kglobal.h> 34#include <kglobal.h>
35#include <kprocess.h> 35#include <kprocess.h>
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38#include <libkdepim/addresseeview.h> 38#include <libkdepim/addresseeview.h>
39#include <kabc/stdaddressbook.h> 39#include <kabc/stdaddressbook.h>
40 40
41#ifndef KORG_NODCOP 41#ifndef KORG_NODCOP
42#include <dcopclient.h> 42#include <dcopclient.h>
43#include "korganizer.h" 43#include "korganizer.h"
44#include "koprefs.h" 44#include "koprefs.h"
45#include "actionmanager.h" 45#include "actionmanager.h"
46#endif 46#endif
47 47
48#include "koeventviewer.h" 48#include "koeventviewer.h"
49#ifndef KORG_NOKABC 49#ifndef KORG_NOKABC
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
57KOEventViewer::KOEventViewer(QWidget *parent,const char *name) 61KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
58 : QTextBrowser(parent,name) 62 : QTextBrowser(parent,name)
59{ 63{
60 mSyncMode = false; 64 mSyncMode = false;
61 mColorMode = 0; 65 mColorMode = 0;
62} 66}
63 67
64KOEventViewer::~KOEventViewer() 68KOEventViewer::~KOEventViewer()
65{ 69{
66} 70}
67 71
68void KOEventViewer::setSource(const QString& n) 72void 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() );
84 QDialog dia( this,"dia123", true ); 87 QDialog dia( this,"dia123", true );
85 dia.setCaption( i18n("Details of attendee") ); 88 dia.setCaption( i18n("Details of attendee") );
86 QVBoxLayout lay ( &dia ); 89 QVBoxLayout lay ( &dia );
87 KPIM::AddresseeView av ( &dia ); 90 KPIM::AddresseeView av ( &dia );
88 av.setAddressee( (*it) ); 91 av.setAddressee( (*it) );
89 lay.addWidget( &av ); 92 lay.addWidget( &av );
90 if ( QApplication::desktop()->width() < 480 ) 93 if ( QApplication::desktop()->width() < 480 )
91 dia.resize( 220, 240); 94 dia.resize( 220, 240);
92 else { 95 else {
93 dia.resize( 400,400); 96 dia.resize( 400,400);
94 97
95 } 98 }
96 dia.exec(); 99 dia.exec();
97 break; 100 break;
98 } 101 }
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
109 } 130 }
110 131
111 132
112#ifndef KORG_NODCOP 133#ifndef KORG_NODCOP
113 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 134 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
114 QString tmpStr; 135 QString tmpStr;
115 if (n.startsWith("mailto:")) { 136 if (n.startsWith("mailto:")) {
116 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 137 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
117 //emit showIncidence(n); 138 //emit showIncidence(n);
118 return; 139 return;
119 } else if (n.startsWith("uid:")) { 140 } else if (n.startsWith("uid:")) {
120 DCOPClient *client = KApplication::kApplication()->dcopClient(); 141 DCOPClient *client = KApplication::kApplication()->dcopClient();
121 const QByteArray noParamData; 142 const QByteArray noParamData;
122 const QByteArray paramData; 143 const QByteArray paramData;
123 QByteArray replyData; 144 QByteArray replyData;
124 QCString replyTypeStr; 145 QCString replyTypeStr;
125#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) 146#define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData))
126 bool foundAbbrowser = PING_ABBROWSER; 147 bool foundAbbrowser = PING_ABBROWSER;
127 148
128 if (foundAbbrowser) { 149 if (foundAbbrowser) {
129 //KAddressbook is already running, so just DCOP to it to bring up the contact editor 150 //KAddressbook is already running, so just DCOP to it to bring up the contact editor
@@ -362,93 +383,106 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
362} 383}
363 384
364void KOEventViewer::formatCategories(Incidence *event) 385void KOEventViewer::formatCategories(Incidence *event)
365{ 386{
366 if (!event->categoriesStr().isEmpty()) { 387 if (!event->categoriesStr().isEmpty()) {
367 if (event->categories().count() == 1) { 388 if (event->categories().count() == 1) {
368 addTag("h3",i18n("Category")); 389 addTag("h3",i18n("Category"));
369 } else { 390 } else {
370 addTag("h3",i18n("Categories")); 391 addTag("h3",i18n("Categories"));
371 } 392 }
372 addTag("p",event->categoriesStr()); 393 addTag("p",event->categoriesStr());
373 } 394 }
374} 395}
375void KOEventViewer::formatAttendees(Incidence *event) 396void KOEventViewer::formatAttendees(Incidence *event)
376{ 397{
377 QPtrList<Attendee> attendees = event->attendees(); 398 QPtrList<Attendee> attendees = event->attendees();
378 if (attendees.count()) { 399 if (attendees.count()) {
379 400
380 401
381 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 402 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
382 addTag("h3",i18n("Organizer")); 403 addTag("h3",i18n("Organizer"));
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());
389 KABC::Addressee o = addressList.first(); 411 KABC::Addressee o = addressList.first();
390 if (!o.isEmpty() && addressList.size()<2) { 412 if (!o.isEmpty() && addressList.size()<2) {
391 mText += "<a href=\"uid:" + o.uid() + "\">"; 413 mText += "<a href=\"uid:" + o.uid() + "\">";
392 mText += o.formattedName(); 414 mText += o.formattedName();
393 mText += "</a>\n"; 415 mText += "</a>\n";
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
400 427
401 if (iconPath) { 428 if (iconPath) {
402 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 429 mText += " <a href=\"mailto:" + event->organizer() + "\">";
403 mText += "<IMG src=\"" + iconPath + "\">"; 430 mText += "<IMG src=\"" + iconPath + "\">";
404 mText += "</a>\n"; 431 mText += "</a>\n";
405 } 432 }
406 mText.append("</li></ul>"); 433 mText.append("</li></ul>");
407 434
408 addTag("h3",i18n("Attendees")); 435 addTag("h3",i18n("Attendees"));
409 Attendee *a; 436 Attendee *a;
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();
416 if (!o.isEmpty() && addressList.size()<2) { 444 if (!o.isEmpty() && addressList.size()<2) {
417 mText += "<a href=\"uid:" + o.uid() + "\">"; 445 mText += "<a href=\"uid:" + o.uid() + "\">";
418 mText += o.formattedName(); 446 mText += o.formattedName();
419 mText += "</a>\n"; 447 mText += "</a>\n";
420 } else { 448 } else {
421 mText += "<li>"; 449 mText += "<li>";
422 mText.append(a->email()); 450 mText.append(a->email());
423 mText += "\n"; 451 mText += "\n";
424 } 452 }
425 } else { 453 } else {
426 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 454 mText += "<li><a href=\"uid:" + a->uid() + "\">";
427 if (!a->name().isEmpty()) mText += a->name(); 455 if (!a->name().isEmpty()) mText += a->name();
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() + "\">";
434 if (!a->name().isEmpty()) mText += a->name(); 468 if (!a->name().isEmpty()) mText += a->name();
435 else mText += a->email(); 469 else mText += a->email();
436 mText += "</a>\n"; 470 mText += "</a>\n";
437#endif 471#endif
438 472
439 473
440 if (!a->email().isEmpty()) { 474 if (!a->email().isEmpty()) {
441 if (iconPath) { 475 if (iconPath) {
442 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; 476 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
443 mText += "<IMG src=\"" + iconPath + "\">"; 477 mText += "<IMG src=\"" + iconPath + "\">";
444 mText += "</a>\n"; 478 mText += "</a>\n";
445 } 479 }
446 } 480 }
447 if (a->status() != Attendee::NeedsAction ) 481 if (a->status() != Attendee::NeedsAction )
448 mText +="[" + a->statusStr() + "] "; 482 mText +="[" + a->statusStr() + "] ";
449 if (a->role() == Attendee::Chair ) 483 if (a->role() == Attendee::Chair )
450 mText +="(" + a->roleStr().left(1) + ".)"; 484 mText +="(" + a->roleStr().left(1) + ".)";
451 } 485 }
452 mText.append("</li></ul>"); 486 mText.append("</li></ul>");
453 } 487 }
454 488
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index d4fadcb..7978b46 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -181,49 +181,51 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
181 181
182 182
183 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 183 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
184 mView->setModified( false ); 184 mView->setModified( false );
185 mBlockAtStartup = false; 185 mBlockAtStartup = false;
186 mView->setModified( false ); 186 mView->setModified( false );
187 setCentralWidget( mView ); 187 setCentralWidget( mView );
188 globalFlagBlockStartup = 0; 188 globalFlagBlockStartup = 0;
189 mView->show(); 189 mView->show();
190 delete splash; 190 delete splash;
191 if ( newFile ) 191 if ( newFile )
192 mView->updateConfig(); 192 mView->updateConfig();
193 // qApp->processEvents(); 193 // qApp->processEvents();
194 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 194 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
195 fillSyncMenu(); 195 fillSyncMenu();
196 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 196 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
197 if ( showWarning ) { 197 if ( showWarning ) {
198 KMessageBox::information( this, 198 KMessageBox::information( this,
199 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 199 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
200 qApp->processEvents(); 200 qApp->processEvents();
201 mView->dialogManager()->showSyncOptions(); 201 mView->dialogManager()->showSyncOptions();
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}
207MainWindow::~MainWindow() 209MainWindow::~MainWindow()
208{ 210{
209 //qDebug("MainWindow::~MainWindow() "); 211 //qDebug("MainWindow::~MainWindow() ");
210 //save toolbar location 212 //save toolbar location
211 213
212 delete mCalendar; 214 delete mCalendar;
213 delete KOPrefs::instance(); 215 delete KOPrefs::instance();
214 delete KIncidenceFormatter::instance(); 216 delete KIncidenceFormatter::instance();
215 217
216 218
217} 219}
218void MainWindow::showMaximized () 220void MainWindow::showMaximized ()
219{ 221{
220#ifndef DESKTOP_VERSION 222#ifndef DESKTOP_VERSION
221 if ( ! globalFlagBlockStartup ) 223 if ( ! globalFlagBlockStartup )
222 mView->goToday(); 224 mView->goToday();
223#endif 225#endif
224 QWidget::showMaximized () ; 226 QWidget::showMaximized () ;
225} 227}
226void MainWindow::closeEvent( QCloseEvent* ce ) 228void MainWindow::closeEvent( QCloseEvent* ce )
227{ 229{
228 230
229 231
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index bd83626..6100097 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -285,49 +285,48 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString
285 285
286} 286}
287 287
288 288
289/*********************************************************************************/ 289/*********************************************************************************/
290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
291{ 291{
292 bool res = QCopTransferItem::appMessage( cmsg, data ); 292 bool res = QCopTransferItem::appMessage( cmsg, data );
293 293
294 if (res == false) 294 if (res == false)
295 { 295 {
296 QDataStream stream( data, IO_ReadOnly ); 296 QDataStream stream( data, IO_ReadOnly );
297 297
298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
299 299
300 //we are in the source and get an answer from the target 300 //we are in the source and get an answer from the target
301 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 301 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
302 { 302 {
303 QStringList list1; 303 QStringList list1;
304 QStringList list2; 304 QStringList list2;
305 QStringList list3; 305 QStringList list3;
306 QString uid; 306 QString uid;
307 307
308 stream >> uid >> list1 >> list2 >> list3; 308 stream >> uid >> list1 >> list2 >> list3;
309
310 emit receivedMessageFromTarget(uid, list1, list2, list3); 309 emit receivedMessageFromTarget(uid, list1, list2, list3);
311 310
312 311
313 return true; 312 return true;
314 } 313 }
315 } 314 }
316 315
317 return false; 316 return false;
318} 317}
319 318
320 319
321 320
322/********************************************************************************* 321/*********************************************************************************
323 * 322 *
324 ********************************************************************************/ 323 ********************************************************************************/
325 324
326 325
327ExternalAppHandler *ExternalAppHandler::sInstance = 0; 326ExternalAppHandler *ExternalAppHandler::sInstance = 0;
328static KStaticDeleter<ExternalAppHandler> staticDeleter; 327static KStaticDeleter<ExternalAppHandler> staticDeleter;
329 328
330ExternalAppHandler::ExternalAppHandler() 329ExternalAppHandler::ExternalAppHandler()
331{ 330{
332 mDefaultItems.setAutoDelete(true); 331 mDefaultItems.setAutoDelete(true);
333 332
@@ -949,49 +948,48 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
949 } 948 }
950 else 949 else
951 { 950 {
952 // qDebug("pass parameter << %s", key.latin1()); 951 // qDebug("pass parameter << %s", key.latin1());
953 (*e) << key; 952 (*e) << key;
954 } 953 }
955 } 954 }
956 955
957 if (useValMap == true) 956 if (useValMap == true)
958 (*e) << valmap; 957 (*e) << valmap;
959 958
960#endif 959#endif
961 960
962} 961}
963 962
964 963
965 964
966/************************************************************************** 965/**************************************************************************
967 * 966 *
968 **************************************************************************/ 967 **************************************************************************/
969 968
970void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) 969void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
971{ 970{
972 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); 971 bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
973
974 if (!res) 972 if (!res)
975 res = mDisplayDetails->appMessage( cmsg, data ); 973 res = mDisplayDetails->appMessage( cmsg, data );
976 974
977// if (!res) 975// if (!res)
978// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); 976// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
979} 977}
980 978
981 979
982 980
983bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) 981bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
984{ 982{
985 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 983 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
986 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); 984 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid);
987} 985}
988 986
989bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 987bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
990{ 988{
991 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 989 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
992 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); 990 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
993} 991}
994 992
995bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) 993bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email)
996{ 994{
997 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); 995 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);