NetworkManager r3496 - in trunk: . libnm-glib



Author: dcbw
Date: Mon Mar 24 19:30:11 2008
New Revision: 3496
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3496&view=rev

Log:
2008-03-24  Dan Williams  <dcbw redhat com>

	* libnm-glib/nm-client.c
		- (client_device_added_proxy): add new devices to the internal device
			list so they appear to clients



Modified:
   trunk/ChangeLog
   trunk/libnm-glib/nm-client.c

Modified: trunk/libnm-glib/nm-client.c
==============================================================================
--- trunk/libnm-glib/nm-client.c	(original)
+++ trunk/libnm-glib/nm-client.c	Mon Mar 24 19:30:11 2008
@@ -426,9 +426,23 @@
 client_device_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
 {
 	NMClient *client = NM_CLIENT (user_data);
-	NMDevice *device;
+	NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
+	GObject *device;
+
+	device = G_OBJECT (nm_client_get_device_by_path (client, path));
+	if (!device) {
+		DBusGConnection *connection = nm_object_get_connection (NM_OBJECT (client));
+
+		device = G_OBJECT (nm_object_cache_get (path));
+		if (device) {
+			g_ptr_array_add (priv->devices, g_object_ref (device));
+		} else {
+			device = G_OBJECT (nm_device_new (connection, path));
+			if (device)
+				g_ptr_array_add (priv->devices, device);
+		}
+	}
 
-	device = nm_client_get_device_by_path (client, path);
 	if (device)
 		g_signal_emit (client, signals[DEVICE_ADDED], 0, device);
 }



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