--- a/pidgin/plugins/gevolution/gevo-util.c Mon Feb 10 17:27:03 2014 +0100 +++ b/pidgin/plugins/gevolution/gevo-util.c Mon Feb 10 18:19:16 2014 +0100 @@ -126,16 +126,39 @@ } gboolean -gevo_load_addressbook(const gchar* uri, EBook **book, GError **error) +gevo_load_addressbook(const gchar* uid, EBook **book, GError **error) +{ + gboolean result = FALSE; + ESourceRegistry *registry; + ESource *source; + + g_return_val_if_fail(book != NULL, FALSE); + + registry = e_source_registry_new_sync(NULL, error); + + if (!registry) + return FALSE; + + if (uid == NULL) + source = e_source_registry_ref_default_address_book(registry); + else + source = e_source_registry_ref_source(registry, uid); + + g_object_unref(registry); + + result = gevo_load_addressbook_from_source(source, book, error); + + g_object_unref(source); + + return result; +} + +gboolean +gevo_load_addressbook_from_source(ESource *source, EBook **book, GError **error) { gboolean result = FALSE; - g_return_val_if_fail(book != NULL, FALSE); - - if (uri == NULL) - *book = e_book_new_system_addressbook(error); - else - *book = e_book_new_from_uri(uri, error); + *book = e_book_new(source, error); if (*book == NULL) return FALSE;