Bug 44917

Summary: TpBaseChannelClass needs a get_interfaces()
Product: Telepathy Reporter: Danielle Madeley <danielle>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Danielle Madeley 2012-01-18 17:12:14 UTC
For TpBaseCallContent etc, we have added a get_interfaces() class method which returns a GPtrArray of interfaces, allowing for the user to chain up the implemented interfaces when inheriting a base class.

Currently as it stands, if I write a concrete class inheriting from TpBaseMediaCallChannel, I need to look at what class->interfaces equals in order to set my own class->interfaces.

I propose adding a get_interfaces() class method to TpBaseChannel, which by default initialises to class->interfaces. And changing the Interfaces property, etc. to use that.
Comment 2 Will Thompson 2012-01-19 01:35:07 UTC
You should update the description for TpBaseChannel:

> Subclasses should fill in TpBaseChannelClass.channel_type, TpBaseChannelClass.target_handle_type and TpBaseChannelClass.interfaces, and implement the TpBaseChannelClass.close virtual function.
Comment 3 Danielle Madeley 2012-01-19 02:10:18 UTC
(In reply to comment #2)
> You should update the description for TpBaseChannel:

Done.

http://cgit.collabora.com/git/user/danni/telepathy-glib.git/commit/?h=call1&id=4197a42b6886c2badd2baa3332eb207cc9afe778
Comment 4 Jonny Lamb 2012-01-19 07:16:23 UTC
Yeah this looks good, except this:

  * Subclasses should fill in #TpBaseChannelClass.channel_type,
- * #TpBaseChannelClass.target_handle_type and #TpBaseChannelClass.interfaces,
- * and implement the #TpBaseChannelClass.close virtual function.
+ * #TpBaseChannelClass.target_handle_type and
+ * #TpBaseChannelClass.get_interfaces, and implement the
+ * #TpBaseChannelClass.close virtual function.

Surely get_interfaces is also a virtual function and so this should read

    Subclasses should fill in [...], and implement the get_interfaces and close
    virtual functions.

No?
Comment 6 Danielle Madeley 2012-01-22 16:38:38 UTC
Apparently xclaesse merged this to master.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.