[Telepathy] [Bug 13896] "invalid property" warning when requesting a channel

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 2 13:34:08 PST 2008


------- Comment #1 from muadda at gmail.com  2008-01-02 13:34 PST -------
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

  chan = g_object_new (GABBLE_TYPE_IM_CHANNEL,
                       "connection", priv->conn,
                       "object-path", object_path,
                       "handle", handle,

g_object_new() calls the constructor with properties as parameters:

  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.


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);
+      /* 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.

Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Telepathy mailing list