[Bug 30296] Add Addressing support to Gabble

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 4 21:39:12 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=30296

--- Comment #8 from Eitan Isaacson <eitan.isaacson at collabora.co.uk> 2010-10-04 12:39:12 PDT ---
(In reply to comment #3)
> +  g_type_set_qdata (G_OBJECT_TYPE (obj),
> +                    GABBLE_ADDRESSING_MIXIN_OFFSET_QUARK,
> +                    GINT_TO_POINTER (offset));
> 
> Shouldn't this go in a mixin_class_init() rather than in an instance init? We
> don't need to re-annotate the type using this mixin every time an instance is
> constructed: the mixin's always at the same offset into the struct. Maybe
> _init_dbus_properties() could become _class_init() and take
> 

Ok, so if you were wondering why most mixin classes we have do this in the
constructor, and not in the class_init, it's because of base classes.
If we mix this into a base class, and pass the base's struct offset, the
derived class has no direct access to it.
For example,
In gabble_base_call_channel_class_init we provide
gabble_addressing_mixin_class_init with an offset in GabbleBaseCallChannel.
But when gabble_base_call_channel_constructed is called, it is a derived
object, so the gtype would be GabbleCallChannel. The only way I see getting
this to work is either moving all of it to the derived classes, or just the
class_init part. None of those options look good to me. I think I will revert
this back to annotating the type in the constructor.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list