NetworkManager r4152 - in trunk: . src



Author: dcbw
Date: Mon Oct  6 19:30:59 2008
New Revision: 4152
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4152&view=rev

Log:
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



Modified:
   trunk/ChangeLog
   trunk/src/nm-device-interface.c
   trunk/src/nm-device.c
   trunk/src/nm-ip4-config.c
   trunk/src/nm-ip4-config.h

Modified: trunk/src/nm-device-interface.c
==============================================================================
--- trunk/src/nm-device-interface.c	(original)
+++ trunk/src/nm-device-interface.c	Mon Oct  6 19:30:59 2008
@@ -90,10 +90,10 @@
 
 	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

Modified: trunk/src/nm-device.c
==============================================================================
--- trunk/src/nm-device.c	(original)
+++ trunk/src/nm-device.c	Mon Oct  6 19:30:59 2008
@@ -1916,7 +1916,7 @@
 	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 @@
 		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))

Modified: trunk/src/nm-ip4-config.c
==============================================================================
--- trunk/src/nm-ip4-config.c	(original)
+++ trunk/src/nm-ip4-config.c	Mon Oct  6 19:30:59 2008
@@ -99,15 +99,12 @@
 	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

Modified: trunk/src/nm-ip4-config.h
==============================================================================
--- trunk/src/nm-ip4-config.h	(original)
+++ trunk/src/nm-ip4-config.h	Mon Oct  6 19:30:59 2008
@@ -54,7 +54,7 @@
 
 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]