GNOME Bugzilla – Bug 693669
expose NMDevice:available-connections
Last modified: 2013-02-14 14:33:44 UTC
noticed in another bug; NMDevice is not exposing its new(ish) available-connections property.
Created attachment 235804 [details] [review] libnm-glib: fix NMRemoteConnection GInitable implementation apparently this never got tested...
Created attachment 235805 [details] [review] libnm-util, libnm-glib: Make NMRemoteConnection instantiable by NMObject In order to resolve NMRemoteConnection-valued properties, NMObject needs to be able to create NMRemoteConnections. But NMObject assumes that all the objects it will be creating have "dbus-connection" and "dbus-path" properties. So add those properties to NMRemoteConnection, aliasing the existing "bus" and "path" properties (and ensure that whichever version gets set, we keep that value, rather than letting it get overwritten by the NULL default value of the other one).
Created attachment 235806 [details] [review] libnm-glib: add NMDevice:available-connections NMDevice has a D-Bus "AvailableConnections" property, but we weren't exposing it on NMDevice. Fix that.
Review of attachment 235804 [details] [review]: Good catch. I wonder how it could work, probably it didn't but was not used.
Review of attachment 235805 [details] [review]: Looks fine. ::: libnm-glib/nm-remote-connection.c @@ +546,3 @@ + "DBus Object Path", + NULL, + "DBusGConnection", Should be indented with spaces. I know there are tabs on many places in g_object_class_install_property(), but we could use spaces for new code.
Review of attachment 235806 [details] [review]: Other than that it is OK. ::: libnm-glib/nm-device.c @@ +343,3 @@ + for (i = 0; i < priv->available_connections->len; i++) + g_object_unref (priv->available_connections->pdata[i]); + g_ptr_array_free (priv->available_connections, TRUE); Freeing in dispose() could be simplified a bit: if (priv->available_connections) { g_ptr_array_foreach (priv->available_connections, (GFunc) g_object_unref, NULL); g_ptr_array_free (priv->available_connections, TRUE); priv->available_connections = NULL; } @@ +1291,3 @@ + * @device: a #NMDevice + * + * Gets the #NMRemoteConnections currently known to the daemon that could #NMRemoteConnections -> #NMRemoteConnection<!-- -->s
(In reply to comment #6) > Review of attachment 235806 [details] [review]: > + * Gets the #NMRemoteConnections currently known to the daemon that could > > #NMRemoteConnections -> #NMRemoteConnection<!-- -->s nope, gtk-doc got fixed at some point (quite a while ago now) to recognize regular plurals. eg, "#SoupSessions" in http://git.gnome.org/browse/libsoup/tree/libsoup/soup-session.c#n3027 becomes http://developer.gnome.org/libsoup/2.41/SoupSession.html#SoupSession--idle-timeout
fixed the indentation. I left the code in dispose() as it was, because it's consistent with other libnm-glib code (and I don't like casting function pointers to types with different numbers of arguments). Attachment 235804 [details] pushed as 7c5cf25 - libnm-glib: fix NMRemoteConnection GInitable implementation Attachment 235805 [details] pushed as 24cda2b - libnm-util, libnm-glib: Make NMRemoteConnection instantiable by NMObject Attachment 235806 [details] pushed as 43f259e - libnm-glib: add NMDevice:available-connections