Re: [Evolution-hackers] Address book merging



Hi Milan,

Thanks for the information, the e-cal-backend-contactsc.c looks very similar to what I am trying to implement.
I tried the approach used on it to load contacts sources but did not work very well with my Addressbook source. 

After click in source on evolution, all others sources stop to work, looks like it is blocking the EDS main thread but I am not able to find a way to avoid that.

What I can say is that, the block only happen if I call "e_book_client_view_start" if I comment this call out the others address books works nice. I tried call it from a thread like the calendar backend does but I got the same problem. Maybe because I am implementing a AddressBook backend and the "Birthdays & Anniversaries " is a calendar backend (just a guess).

I have tried a lot of different ways to call "e_book_client_view_start" (idle functions, threads, timeout functions) none of that works, and I do not find another way to check for contacts changes without use a view, and I am not sure how I can use this function inside of my backend implementation.

I have a small backend[1] with only the constructor function implemented where I try to start a view from others sources to confirm the problem. Should I report a bug or I am doing something wrong on my code?

Thanks again
Renato

[1] https://github.com/renatofilho/evolution-source/tree/master/src



Renato Araujo Oliveira Filho

On Thu, Feb 19, 2015 at 4:00 AM, Milan Crha <mcrha redhat com> wrote:
On Wed, 2015-02-18 at 16:30 -0300, Renato Araujo wrote:
> Could you guys help me with that?

        Hi,
I wasn't sure what kind of merge you have on mind. I can think of a
real contact merge, like when adding a new contact to an address book
and searching for a similar contact (like based on e-mail) and
eventually ask a user to merge the newly added contact with an already
existing. Or, the other merge kind, is to gather contacts from
multiple books and show them all in one long list (I have configured
really many books, and some contains thousands of contacts, thus your
application should count with it; there are also company books with
hundreds of thousands of contacts).

I then realized, after reading your email, that you most likely need
to do the second kind of the merge, provide contacts from multiple
books in once source.

> Is this idea too crazy?

No, it isn't.

> Do you have any other idea to have contact from different address-
> book merged in EDS?

It's what the ENameSelector from evolution does. It's used for auto-
completion and it picks all books configured to be part of the auto-
completion and searches for available contacts in all these books at
once. Check the ENameSelectorEntry [1] and EContactStore [2], the
later is that what gathers contacts from the books.

> Is possible to use client API inside of the backend implementation?
> (How?)

Yes, it is. Check the Birthdays & Anniversaries calendar code [3], it
also uses books. It can be a little issue to ask for clients in the
server side which provides those clients (you ask to open a book in a
book backend, which wants to talk to the book factory, thus to
itself). You might be also careful which thread you block with your
client open. If you block the main thread of the factory, then any
attempt to contact it, by any client, will cause timeouts.

> Which is the best solution to get access to others addressbook from
> my backend implemation?
>

See the answer for the previous question.

        Hope it helps,
        Milan

[1] https://git.gnome.org/browse/evolution/tree/e-util/e-name-selector-entry.c
[2] https://git.gnome.org/browse/evolution/tree/e-util/e-contact-store.c
[3] https://git.gnome.org/browse/evolution-data-server/tree/calendar/backends/contacts/e-cal-backend-contacts.c
_______________________________________________
evolution-hackers mailing list
evolution-hackers gnome org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-hackers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]