author | zautrix <zautrix> | 2004-09-07 20:33:23 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-07 20:33:23 (UTC) |
commit | 64a8ef1629f523df3006de5cb2b9882a50d96a05 (patch) (side-by-side diff) | |
tree | b931dc5397b4eec926603080b20eddda131999ff /kaddressbook | |
parent | 9d5c8750ae671e73ec8ebc0a71f30fd30680f2c0 (diff) | |
download | kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.zip kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.gz kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.bz2 |
Fixed Kopi-Kapi external app communication
-rw-r--r-- | kaddressbook/kabcore.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4299ebd..2f9f1df 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -2032,73 +2032,76 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt 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()); + //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()) { //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(); + if ((namelist.count() == 0) && (emaillist.count() > 0)) { + foundUid = emaillist[0].uid(); + } else if ((namelist.count() > 0) && (emaillist.count() == 0)) - foundUid == namelist[0].uid(); + 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(); + 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()"); + //QCopEnvelope e("QPE/Application/kapi", "raise()"); #endif #endif - + mMainWindow->showMaximized(); + mMainWindow-> raise(); mViewManager->setSelected( "", false); mViewManager->refreshView( "" ); mViewManager->setSelected( foundUid, true ); mViewManager->refreshView( foundUid ); if ( !mMultipleViewsAtOnce ) { setDetailsVisible( true ); mActionDetails->setChecked(true); } } |