summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-09-07 20:33:23 (UTC)
committer zautrix <zautrix>2004-09-07 20:33:23 (UTC)
commit64a8ef1629f523df3006de5cb2b9882a50d96a05 (patch) (unidiff)
treeb931dc5397b4eec926603080b20eddda131999ff /kaddressbook
parent9d5c8750ae671e73ec8ebc0a71f30fd30680f2c0 (diff)
downloadkdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.zip
kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.gz
kdepimpi-64a8ef1629f523df3006de5cb2b9882a50d96a05.tar.bz2
Fixed Kopi-Kapi external app communication
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp19
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
@@ -2040,9 +2040,9 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt
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 {
@@ -2054,23 +2054,24 @@ void KABCore::requestForDetails(const QString& sourceChannel, const QString& ses
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 }
@@ -2081,16 +2082,18 @@ void KABCore::requestForDetails(const QString& sourceChannel, const QString& ses
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 );