Re: [Evolution-hackers] libebook and E-D-S questions / help
- From: Sven Pfaller <kalterregen gmx net>
- To: evolution-hackers gnome org
- Subject: Re: [Evolution-hackers] libebook and E-D-S questions / help
- Date: Mon, 04 Aug 2008 12:26:57 +0200
Hi Patrick.
Patrick Ohly schrieb:
On Fri, 2008-08-01 at 16:14 +0200, Sven Pfaller wrote:
libsoylent uses libebook extensively, so I am working longer than a
month with libebook and libebook-data now. Some questions queued up, and
I would also be thankful for some help as I am stuck with some bugs (?)
at the moment.
I have used some parts of libebook in SyncEvolution and can try to
answer some questions, but probably not all.
Okay, here are my points:
* attribute-value-lists:
When I call e_vcard_attribute_get_values, I get a list of values. For
example if I call it on the ADDR attribute, I get a list like:
"foo-street", "foo-city", "foo-region" ...
If two addresses exist, the list looks like this:
"foo-street", "foo-city", "foo-region", "bar-street", "bar-city",
"bar-region" ...
Is there a way to retrieve the raw vCard strings as a list?
I don't think so. You can get the complete vCard or none, but not parts
of it.
This raises the question how Evolution processes this value-list. It has
to know somehow that the first 6 values of ADDR are the home address,
the next 6 are the work address and so on. The type parameters
(TYPE=home, TYPE=work) are also given as list. So, if the first
parameter is TYPE=home, then Evolution takes the first 6 values of ADDR
as home-address, and if the second is TYPE=work then it takes the next 6
as work-address? This feels kind of strange to me. Can anyone confirm
that, or outline how Evolution really does it?
* creating a system-addressbook
On a fresh system, where Evolution hasn't been run yet, there exists no
system-addressbook. libsoylent relies on a system-addressbook, so it has
to create it if it doesn't exist yet. I didn't find anything about that
in the documentation or in the Evolution source. Could you please give
me a hint or point me to the right location in the Evolution source?
You can create a new address book with e_book_new_from_uri() and a
"file://" URI. However, this address book is not visible in Evolution.
Some special sauce is necessary to make the recipe complete. For
example, adding entries to the gconf database. I don't know where
Evolution does that work.
Seems like I missed the file:// URI. Is there some default path that I
should use for the addressbook (under Ubuntu it seems like
~/.evolution/addressbook/local ?) or a way to obtain the path for local
addressbooks (like an environment variable)?
I already managed to make the addressbook visible to the system, it is
done via e_source_list_sync.
* adding contacts to an addressbook
libsoylent creates addressbooks with calls to e_source_new,
e_source_group_add, e_sourc_list_sync.
However, if I try to add contacts to an addressbook created this way,
E-D-S will just hang forever.
Detailed source-code is attached. Help would be highly appreciated :) .
Should I file a bug for this?
Before you do that you'll need to figure out what happens in EDS. Run it
in a shell window by starting evolution-data-server manually before
Evolution does it automatically. Also install the debug information for
it and if it crashes, use a debugger to find out where and why.
I suspect that you are doing something that crashes it, in which case
clients using the synchronous API hang forever. This is a known problem
that was discussed on this list a while ago; there's no good solution.
The workaround that I tried (running the necessary event loops in a
second thread) caused crashes, so I removed it again from SyncEvolution.
I'll try first to find out if the symptom is fixed when creating an
addressbook with the file:// URI. If the problem persists I will take
your advice and try to trace down the cause of the error.
* deleting an addressbook
This one seems related to the "adding contacts" problem. Trying to
delete addressbooks that were created like described above will result
in e_book_remove throwing an "EDS-Status returned 20" error.
No idea. Again, tracking the call in EDS with a debugger will tell you
more.
Okay, that's it. If you could help me, that would make me ueber-happy ;)
. Just tell me if you need more information.
Giving the version of your Evolution and (presumably) Linux distribution
would be a start...
Sorry, I totally missed it.
I'm running Ubuntu 8.04 Hardy, fully updated.
libebook & E-D-S: 2.22.3-0ubuntu1
Thanks for your help Patrick, I really appreciate it :)
See you
- Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]