[haiku-development] Re: People/Person format extension

  • From: Barrett <barrett666@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 2 Nov 2011 16:17:57 +0100

> There is no such "file format" to Peole files exactly because they
> aren't files in terms of content.

Right, sorry for mine imprecision.

> Besides, there is no reason to define yet another format for that.
> Should we choose to switch to a file-backed format for contacts they we
> must use vCard, as it's the standard.

This was already discussed in ml, and later with my mentor's...afair it was
an excluded option.

> I think Caya already uses them.

No vcard support for caya.

> vCard has an extension mechanism that we can use to store what we want:
> http://en.wikipedia.org/wiki/VCard#vCard_extensions

Yeah, i know...extensions aren't the problem really.

> Then we can just keep the attributes around for quick search but have
> the contact editor update them from the file content.

Ok, i'm not personally against it and i have already think about it during
gsoc, but why duplicate things when we can just write flattened
BContactField object into the file to save non-attributes-friendly data?

Secondarily, you have a Qt VCard editor on Haiku. You edit this file that
appears to the editor as vcard, the attributes aren't updated as
consequence. Yes, People can just update them when reading, but i think
it's a unnedeed complexity and gives us other problems (like if the user,
will never open the file using People, so the attrs will never get
updated). Really, it seems a windows style thing for me.

> > The compatibility with old versions will be guaranteed by the presence of
> > one translator per file format. The old format translator for safety will
> > check if a file is written using the new format returning B_NO_TRANSLATOR
> > accordingly. Likewise the new format will check if a file is written
> using
> > the old format.
> Using a Translator to save to people files is an option yes, though if
> we keep the same attributes it should work as is in most apps.

My branch actually has a modified version of People with all low level code
moved into translators.

> Oh you mean from a flattened object ?
> Well I suppose the app can use whatever format internally, but it should
> definitely save as vCard.
> And keep extra data it doesn't know about when saving back...

Making BContactField a BFlattenable object the intention was to make it
easily and fastly readable/writable, so that's why the idea to make a
People/BContact hybrid.

Other related posts: