2008-10-06 Dan Williams <dcbw@redhat.com>

* src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- nm_ip4_config_is_exported -> nm_ip4_config_get_dbus_path

	* src/nm-device-interface.c
		- (nm_device_interface_init): make 'ip4-config' a boxed property of type
			DBUS_TYPE_G_OBJECT_PATH so that we can make it NULL when we need to
			by using '/' for the object path

	* src/nm-device.c
		- (src/nm-device.c): marshal missing/unexported ip4-config through
			dbus as '/' since dbus-glib can't handle NULL objects nor can
			dbus handle NULL object paths



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4152 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-10-06 19:30:59 +00:00
parent 724ece22c4
commit c468809b57
5 changed files with 25 additions and 12 deletions

View file

@ -1,3 +1,19 @@
2008-10-06 Dan Williams <dcbw@redhat.com>
* src/nm-ip4-config.c
src/nm-ip4-config.h
- nm_ip4_config_is_exported -> nm_ip4_config_get_dbus_path
* src/nm-device-interface.c
- (nm_device_interface_init): make 'ip4-config' a boxed property of type
DBUS_TYPE_G_OBJECT_PATH so that we can make it NULL when we need to
by using '/' for the object path
* src/nm-device.c
- (src/nm-device.c): marshal missing/unexported ip4-config through
dbus as '/' since dbus-glib can't handle NULL objects nor can
dbus handle NULL object paths
2008-10-03 Alexander Sack <asac@ubuntu.com>
Implement system hostname support for debian/ubuntu

View file

@ -90,10 +90,10 @@ nm_device_interface_init (gpointer g_iface)
g_object_interface_install_property
(g_iface,
g_param_spec_object (NM_DEVICE_INTERFACE_IP4_CONFIG,
g_param_spec_boxed (NM_DEVICE_INTERFACE_IP4_CONFIG,
"IP4 Config",
"IP4 Config",
G_TYPE_OBJECT,
DBUS_TYPE_G_OBJECT_PATH,
G_PARAM_READWRITE));
g_object_interface_install_property

View file

@ -1916,7 +1916,7 @@ nm_device_set_ip4_config (NMDevice *self, NMIP4Config *config, NMDeviceStateReas
priv->ip4_config = g_object_ref (config);
/* Export over D-Bus if needed */
if (!nm_ip4_config_is_exported (config))
if (!nm_ip4_config_get_dbus_path (config))
nm_ip4_config_export (config);
success = nm_system_device_set_from_ip4_config (ip_iface, config, nm_device_get_priority (self));
@ -2212,9 +2212,9 @@ get_property (GObject *object, guint prop_id,
break;
case NM_DEVICE_INTERFACE_PROP_IP4_CONFIG:
if ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG))
g_value_set_object (value, priv->ip4_config);
g_value_set_boxed (value, nm_ip4_config_get_dbus_path (priv->ip4_config));
else
g_value_set_object (value, NULL);
g_value_set_boxed (value, "/");
break;
case NM_DEVICE_INTERFACE_PROP_DHCP4_CONFIG:
if ( ((state == NM_DEVICE_STATE_ACTIVATED) || (state == NM_DEVICE_STATE_IP_CONFIG))

View file

@ -99,15 +99,12 @@ nm_ip4_config_export (NMIP4Config *config)
g_object_unref (dbus_mgr);
}
gboolean
nm_ip4_config_is_exported (NMIP4Config *config)
const char *
nm_ip4_config_get_dbus_path (NMIP4Config *config)
{
NMIP4ConfigPrivate *priv;
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), FALSE);
priv = NM_IP4_CONFIG_GET_PRIVATE (config);
return !!priv->path;
return NM_IP4_CONFIG_GET_PRIVATE (config)->path;
}
void

View file

@ -54,7 +54,7 @@ GType nm_ip4_config_get_type (void);
NMIP4Config * nm_ip4_config_new (void);
void nm_ip4_config_export (NMIP4Config *config);
gboolean nm_ip4_config_is_exported (NMIP4Config *config);
const char *nm_ip4_config_get_dbus_path (NMIP4Config *config);
void nm_ip4_config_take_address (NMIP4Config *config, NMSettingIP4Address *address);
void nm_ip4_config_add_address (NMIP4Config *config, NMSettingIP4Address *address);