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.

Thanks
Karl
--- 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);
 			}
 		}
 	}
void
init (void)
{
	GSList *list, *l;
	ESourceList *source_list;

	source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
	if (source_list == NULL) {
		return;
	}

	list = e_source_list_peek_groups (source_list);

	for (l = list; l != NULL; l = l->next) {
		ESourceGroup *group = l->data;
		GSList *sources = NULL, *m;
		sources = e_source_group_peek_sources (group);
		for (m = sources; m != NULL; m = m->next) {
			ESource *source = m->data;
			const char *p;

			p = e_source_get_property (source, "completion");

			if (p != NULL && strcmp (p, "true") == 0) {
				EBook *book = e_book_new (source, NULL);
				if (book != NULL) {
					books = g_slist_prepend (books, book);
					e_book_open(book, TRUE, NULL);
				}
			}
		}
	}

	g_object_unref (source_list);
}
_______________________________________________
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers

Reply via email to