Summary: | "invalid property" warning when requesting a channel | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Alban Crequy <alban.crequy> |
Component: | general | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | ollisal |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | You need no-op code similar to this in the _set_property callback of each TpChannelIface implementation |
Description
Alban Crequy
2008-01-02 09:47:04 UTC
Contrary to what I said, the warning also appear on previous versions, and with online contacts. The object gabble_im_channel_class contains 5 properties: connection, object-path, handle, channel-type and handle-type. But only 3 are initialized here: im-factory.c:new_im_channel(): chan = g_object_new (GABBLE_TYPE_IM_CHANNEL, "connection", priv->conn, "object-path", object_path, "handle", handle, NULL); g_object_new() calls the constructor with properties as parameters: gabble-im-channel.c:gabble_im_channel_constructor(): gabble_im_channel_constructor (GType type, guint n_props, GObjectConstructParam *props) { [...] obj = G_OBJECT_CLASS (gabble_im_channel_parent_class)-> constructor (type, n_props, props); However, the constructor receives values for all 5 properties, and not only the 3 from g_object_new(), because according to (*), construction parameters which are not explicitly specified are set to their default values. (*) http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-new The warning can be removed with: --- old-telepathy-gabble-cassidy/src/gabble-im-channel.c 2008-01-02 22:24:50.000000000 +0100 +++ new-telepathy-gabble-cassidy/src/gabble-im-channel.c 2008-01-02 22:24:50.000000000 +0100 @@ -180,6 +180,12 @@ g_free (priv->object_path); priv->object_path = g_value_dup_string (value); break; + case PROP_CHANNEL_TYPE: + /* The channel type is a constant: TP_IFACE_CHANNEL_TYPE_TEXT and must + * not be changed. However, g_object_new() set all properties, so we get + * called to change the property PROP_CHANNEL_TYPE. + */ + break; case PROP_HANDLE: /* we don't ref it here because we don't necessarily have access to the * contact repo yet - instead we ref it in the constructor. This warning is fairly harmless; it's caused by having a bleeding-edge version of telepathy-glib, which changes the channel type from read-only to read/write. The other GLib connection managers will have the same bug. I'll make sure to fix them all before releasing the current darcs telepathy-glib. Note that darcs versions of telepathy-glib have no API or ABI stability guarantees - we only guarantee that ABI will not be broken once it has appeared in a release of telepathy-glib. You'll have to recompile (or at least relink) Empathy and any other locally compiled Telepathy components when you upgrade to a released version of telepathy-glib. Created attachment 13516 [details] [review] You need no-op code similar to this in the _set_property callback of each TpChannelIface implementation Fixed in darcs for Gabble, Salut, Haze. Similar patches queued for review for Idle and telepathy-sofiasip, and I'll file a bug against gnome-phone-manager. If anyone else encounters this problem, the solution is to check all your implementations of TpChannelIface to make sure they won't warn when the channel-type property is written. Having the set callback be a no-op for the channel type, like it often already is for the handle type, is the simplest solution (see attached). The same bug in gnome-phone-manager: http://bugzilla.gnome.org/show_bug.cgi?id=507258 Merged to idle darcs head. OK, I think we've fixed this in HEAD of all the CMs... |
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.