author | zautrix <zautrix> | 2004-09-07 22:51:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-07 22:51:29 (UTC) |
commit | 2676646d4744ccceab1063dc02d772a26a203c61 (patch) (side-by-side diff) | |
tree | 0a0d5261b9a804a29b61a38f68339979051282e2 /kaddressbook | |
parent | 64a8ef1629f523df3006de5cb2b9882a50d96a05 (diff) | |
download | kdepimpi-2676646d4744ccceab1063dc02d772a26a203c61.zip kdepimpi-2676646d4744ccceab1063dc02d772a26a203c61.tar.gz kdepimpi-2676646d4744ccceab1063dc02d772a26a203c61.tar.bz2 |
Implemented Ompi - kapi connection
-rw-r--r-- | kaddressbook/kabcore.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2f9f1df..6522ccc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1998,98 +1998,116 @@ void KABCore::configureKeyBindings() { #ifndef KAB_EMBEDDED KKeyDialog::configure( actionCollection(), true ); #else //KAB_EMBEDDED qDebug("KABCore::configureKeyBindings() not implemented"); #endif //KAB_EMBEDDED } #ifdef KAB_EMBEDDED void KABCore::configureResources() { KRES::KCMKResources dlg( this, "" , 0 ); if ( !dlg.exec() ) return; KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); } #endif //KAB_EMBEDDED /* this method will be called through the QCop interface from Ko/Pi to select addresses * for the attendees list of an event. */ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) { QStringList nameList; QStringList emailList; QStringList uidList; KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); uint i=0; for (i=0; i < list.count(); i++) { nameList.append(list[i].realName()); emailList.append(list[i].preferredEmail()); uidList.append(list[i].uid()); } bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); } /* this method will be called through the QCop interface from other apps to show details of a contact. */ void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) { //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); - QString foundUid = QString::null; - if (uid.isEmpty()) + QString foundUid = QString::null; + if ( ! uid.isEmpty() ) { + Addressee adrr = mAddressBook->findByUid( uid ); + if ( !adrr.isEmpty() ) { + foundUid = uid; + if ( email == "sendbacklist" ) { + QStringList nameList; + QStringList emailList; + QStringList uidList; + nameList.append(adrr.realName()); + emailList = adrr.emails(); + uidList.append( adrr.preferredEmail()); + bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); + } + } + } + + if ( email == "sendback" ) + return; + if (foundUid.isEmpty()) { //find the uid of the person first Addressee::List namelist; Addressee::List emaillist; if (!name.isEmpty()) namelist = mAddressBook->findByName( name ); if (!email.isEmpty()) emaillist = mAddressBook->findByEmail( email ); qDebug("count %d %d ", namelist.count(),emaillist.count() ); //check if we have a match in Namelist and Emaillist if ((namelist.count() == 0) && (emaillist.count() > 0)) { foundUid = emaillist[0].uid(); } else if ((namelist.count() > 0) && (emaillist.count() == 0)) foundUid = namelist[0].uid(); else { for (int i = 0; i < namelist.count(); i++) { for (int j = 0; j < emaillist.count(); j++) { if (namelist[i] == emaillist[j]) { foundUid = namelist[i].uid(); } } } } } else { foundUid = uid; } if (!foundUid.isEmpty()) { // raise Ka/Pi if it is in the background #ifndef DESKTOP_VERSION #ifndef KORG_NODCOP //QCopEnvelope e("QPE/Application/kapi", "raise()"); #endif #endif mMainWindow->showMaximized(); mMainWindow-> raise(); |