Re: [Deskbar] Searching contacts via e-d-s ldap addressbook



Nigel

Please see comment from Srinivasa Ragavan <sragavan novell com>
(Evolution maintainer) confirming patch makes sense.

Also I've attached a revised patch removing the uri variable.

Cheers
Karl


------
> It looks fine to use e_book_new (SOURCE, ERROR)
> 
> -Srini.
> 
> On Thu, 2007-08-02 at 21:56 +0100, Karl Relton wrote:
> > Hi friends
> > 
> > The deskbar-applet utility uses e-d-s to search through evo
> > addressbooks. However the code used wasn't working on evo-ldap
> > addressbooks.
> > 
> > On investigation, I found the code was using e_book_new_from_uri
> when it
> > could have simply been using e_book_new. Changing as per the
> attached
> > patch fixes the problem.
> > 
> > The maintainer of deskbar applet would like an Evo guru to just give
> a
> > nod or thumbs up that this makes sense, before he commits.
> > 
> > Can someone please take a look - I've included the whole function in
> the
> > 2nd attachment to give the overall context.
> > 

----------

On Tue, 2007-07-31 at 19:10 +1000, Nigel Tao wrote:
> > Searching contacts from evolution-data-server ldap addressbooks doesn't
> > seem to work. I think this received some discussion about a year ago.
> >
> > The attached patch makes it work - at least for me.
> 
> Sure, it's a tiny patch, but I don't know how to test it.  To be
> honest, I don't use Evolution at all these days, just webmail.  Even
> when I was running Evolution, I didn't have an LDAP back-end.
> 
> If you can get some evolution-savvy people to look over this patch
> (and approve it), then I can commit it.  IIRC I was just copying
> contact-lookup-applet code, without really understanding all the e-d-s
> stuff.
> 
> If it is the right thing to do, then we also don't need the char *uri
> variable at all, and can delete that bit of code too.
> 
--- evolution.c.orig	2007-08-02 21:45:02.000000000 +0100
+++ evolution.c	2007-08-02 21:47:14.000000000 +0100
@@ -215,13 +215,11 @@ init (void)
 			p = e_source_get_property (source, "completion");
 
 			if (p != NULL && strcmp (p, "true") == 0) {
-				char *uri = g_strdup_printf ("%s/%s", e_source_group_peek_base_uri (group), e_source_peek_relative_uri (source));
-				EBook *book = e_book_new_from_uri (uri, NULL);
+				EBook *book = e_book_new (source, NULL);
 				if (book != NULL) {
 					books = g_slist_prepend (books, book);
 					e_book_open(book, TRUE, NULL);
 				}
-				g_free (uri);
 			}
 		}
 	}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]