int main(int argc, char **argv)
{
- EBook *book;
+ EBookClient *client;
ESourceRegistry *eds_source_registry = NULL;
EBookClient *ebc;
ESource *source;
- EBookQuery *query;
- GList *contacts;
+ GSList *contacts;
GList *sources;
GList *g, *s;
- GList *c;
+ GSList *c;
GError *error = NULL;
GOptionContext *optioncontext;
}
} else {
char *qu = g_strdup_printf ("(is \"id\" \"%s\")", id);
- query = e_book_query_from_string(qu);
- sources = e_source_registry_list_sources (eds_source_registry, NULL);
+ sources = e_source_registry_list_sources (eds_source_registry, E_SOURCE_EXTENSION_ADDRESS_BOOK);
for (s = sources ; s; s = s->next) {
source = E_SOURCE(s->data);
- book = e_book_new(source, &error);
- e_book_open(book, TRUE, &error);
- e_book_get_contacts(book, query, &contacts, &error);
+ client = E_BOOK_CLIENT(e_book_client_connect_sync(source, NULL, &error));
+ e_book_client_get_contacts_sync(client, qu, &contacts, NULL, &error);
for (c = contacts; c; c = c->next) {
if (full_name)
}
g_object_set(E_CONTACT(c->data), "email", el, NULL);
}
- e_book_commit_contact(book, E_CONTACT(c->data), &error);
+ e_book_client_modify_contact_sync(client, E_CONTACT(c->data), NULL, &error);
}
}
- e_book_query_unref (query);
g_free(qu);
}
return 0;