Re: [Evolution-hackers] Adding a source to a source group
- From: Rodrigo Moya <rodrigo ximian com>
- To: Damien Sandras <dsandras seconix com>
- Cc: evolution-hackers lists ximian com
- Subject: Re: [Evolution-hackers] Adding a source to a source group
- Date: Sat, 15 May 2004 20:28:31 +0200
On Sat, 2004-05-15 at 19:08 +0200, Damien Sandras wrote:
> Hi all,
>
> I'm experiencing the following problem. I want to add an ESource to an
> ESourceGroup corresponding to the local addressbooks. It seems to work,
> and if I add a contact to the newly created ESource, it appears in
> ~/.evolution/addressbook/local
>
> However, the new ESource never appears in Evolution. I noticed that
> they /apps/evolution/addressbook/sources key is not updated and doesn't
> contain the new ESource.
>
> Am I supposed to modify that GConf key myself?
>
> The code is here :
> source_group = gnomemeeting_addressbook_get_local_source_group ();
> printf ("Will add Address Book to Source Group: %s\n",
> e_source_group_peek_name (source_group));
>
> source = e_source_new ("", "");
>
> e_source_set_name (source, addressbook->name);
> e_source_set_relative_uri (source, e_source_peek_uid (source));
> e_source_set_group (source, source_group);
>
> e_source_group_add_source (source_group, source, -1);
>
you need to add the groups to an ESourceList. That is, first get the
correct ESourceList:
source_list = e_source_list_new_for_gconf (gconf_client,
"/apps/evolution/addressbook/sources");
then add the groups and the sources, and then, call e_source_list_sync,
so that the new source is saved immediately to GConf.
cheers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]