Re: Using Tinymail for exposing a folder through DBUS



On Mon, 2007-03-05 at 16:50 +0100, Jo Vermeulen wrote:
> On Mon, 2007-03-05 at 15:57 +0100, Philip Van Hoof wrote:
 
> > If it means "parsing the GConf keys of Evolution and reusing the same
> > accounts's configuration", then yes .. you could implement a TnyAccount-
> > Store implementation that does this, and keep your own backing store
> > separate from the Evolution one.
> 
> That would do I guess :-)

Right, so in that case it's pretty straight forward: just implement a
TnyAccountStore (it's a factory that creates TnyAccount instances using
your configuration).

Modest, which is an E-mail client being developed on top of tinymail,
implements such an account-store. Other samples of such account stores
are available in libtinymail-maemo, libtinymail-olpc, libtinymail-gpe,
and libtinymail-gnome-desktop.

The difficulty will be parsing the XML that is stored per account by
Evolution (will it's not really that difficult, and the parsing code is
available in Evolution's code of course too).

The GConf key is something like /apps/evolution/mail/accounts I think.
This is a string-list with XML buffers that describe the account. What
you need most is the "url_string".

Hint: You have an API called tny_account_set_url_string that you can use
after creating the instance in that TnyAccountStore factory.

Other than that, use whatever you like in the cache_dir property of the
TnyAccountStore implementation. For example $HOME/.yourapp/mail. Of
course take a look at the existing implementations on how to do that
correctly with GLib.

> > In neither cases would the already retrieved summary be reused (as in
> > tinymail both the format and the filename of the summary has been
> > changed). In the first case would already retrieved E-mails be reused,
> > when the application on top of tinymail would tny_folder_get_msg the
> > E-mail.
> 
> That's no problem if it would have to do the summaries again.

Soon you can set a TnyFolder instance not to cache E-mails locally. A
draw-back is that you'll always have to be online to get any E-mail
(also already retrieved E-mails). A benefit is that the E-mail wont be
stored locally after getting it.






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