Bug 44917 - TpBaseChannelClass needs a get_interfaces()
Summary: TpBaseChannelClass needs a get_interfaces()
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-01-18 17:12 UTC by Danielle Madeley
Modified: 2012-01-22 16:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.