[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] [PATCH] bugfix #87233 "open in addressbook"
From:       Martin =?iso-8859-15?q?K=F6bele?= <martin () mkoebele ! de>
Date:       2004-08-15 11:43:12
Message-ID: 200408151343.12461.martin () mkoebele ! de
[Download RAW message or body]

Hi,

this is a patch which fixes #87233:

"Open in Adressbook" doesn't work in the case:
- kmail is run within kontact
- kaddressbook was not loaded yet

My patch fixes this.
It contains a small change in libkdenetwork/kaddrbook.cpp

Please check. 
Thanks!


Martin

["openInaddressBookFix.patch" (text/x-diff)]

? openInaddressBookFix.patch
Index: kaddrbook.cpp
===================================================================
RCS file: /home/kde/kdepim/libkdenetwork/kaddrbook.cpp,v
retrieving revision 1.4
diff -u -p -r1.4 kaddrbook.cpp
--- kaddrbook.cpp	19 Jun 2004 20:08:43 -0000	1.4
+++ kaddrbook.cpp	15 Aug 2004 11:38:18 -0000
@@ -16,6 +16,7 @@
 #include <kabc/distributionlist.h>
 #include <kabc/vcardconverter.h>
 #include <dcopref.h>
+#include <dcopclient.h> 
 
 #include <qregexp.h>
 
@@ -24,7 +25,15 @@ void KAddrBookExternal::openEmail( const
   //QString email = KMMessage::getEmailAddr(addr);
   KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
   KABC::Addressee::List addresseeList = addressBook->findByEmail(email);
-  kapp->startServiceByDesktopName( "kaddressbook" );
+  if ( kapp->dcopClient()->isApplicationRegistered( "kaddressbook" ) ){
+    //make sure kaddressbook is loaded, otherwise showContactEditor
+    //won't work as desired, see bug #87233
+    DCOPRef call ( "kaddressbook", "kaddressbook" );
+    call.send( "newInstance()" );
+  }
+  else
+    kapp->startServiceByDesktopName( "kaddressbook" );
+    
   DCOPRef call( "kaddressbook", "KAddressBookIface" );
   if( !addresseeList.isEmpty() ) {
     call.send( "showContactEditor(QString)", addresseeList.first().uid() );


_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic