Bug 665692 — Use constructors correctly
authorPhilip Withnall <philip@tecnocode.co.uk>
Tue, 6 Dec 2011 23:09:14 +0000 (23:09 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Sat, 10 Dec 2011 18:35:07 +0000 (18:35 +0000)
commit2247cdd5f71a65f330343da2438e68fb8a3ecfd3
tree1f9b858496db700f2f758dfd456893ce5e59d62a
parent04b30abb398bb269d29701da833315f9f04e0818
Bug 665692 — Use constructors correctly

In order to allow libfolks to be used from introspected languages (such as
Python) properly, we need to correctly use the GObject construction process,
rather than generating code which does all object initialisation inside
a *_new() function. This involves moving lots of code into construct{} blocks.

There are some complications; mostly the need for various private variables to
now be exposed as construct-only properties. Most of them should've been
anyway.

Other complications arose from the fact that moving code to a construct{}
block can subtly change the execution order of the code if the Object() call
lists properties which are non-construct properties (e.g. the “alias” property
of a Persona). The setters for these properties will now be called _after_ the
construct{} code, whereas previously they would've been called beforehand.
This rears its head in Tpf.Persona, but hopefully nowhere else.

Closes: bgo#665692
33 files changed:
NEWS
backends/eds/eds-backend.vala
backends/eds/lib/edsf-persona-store.vala
backends/eds/lib/edsf-persona.vala
backends/eds/lib/memory-icon.vala
backends/key-file/kf-backend.vala
backends/key-file/kf-persona-store.vala
backends/key-file/kf-persona.vala
backends/libsocialweb/lib/swf-persona-store.vala
backends/libsocialweb/lib/swf-persona.vala
backends/libsocialweb/sw-backend.vala
backends/telepathy/lib/tpf-logger.vala
backends/telepathy/lib/tpf-persona-store-cache.vala
backends/telepathy/lib/tpf-persona-store.vala
backends/telepathy/lib/tpf-persona.vala
backends/telepathy/tp-backend.vala
backends/tracker/lib/trf-persona-store.vala
backends/tracker/lib/trf-persona.vala
backends/tracker/tr-backend.vala
folks/abstract-field-details.vala
folks/avatar-cache.vala
folks/backend-store.vala
folks/debug.vala
folks/individual-aggregator.vala
folks/individual.vala
folks/note-details.vala
folks/object-cache.vala
folks/phone-details.vala
folks/postal-address-details.vala
folks/potential-match.vala
folks/role-details.vala
folks/url-details.vala
folks/web-service-details.vala