NetworkManager r3269 - in trunk: . libnm-glib



Author: dcbw
Date: Thu Jan 24 19:07:14 2008
New Revision: 3269
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3269&view=rev

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

	* libnm-glib/nm-device-802-11-wireless.c
		- (get_access_point): move the "/" check here; check for invalid path
			too
		- (nm_device_802_11_wireless_set_active_ap): leave the "/" check up
			to get_access_point()
		- (access_point_added_proxy, access_point_removed_proxy): don't try
			to send signals for non-existent access points



Modified:
   trunk/ChangeLog
   trunk/libnm-glib/nm-device-802-11-wireless.c

Modified: trunk/libnm-glib/nm-device-802-11-wireless.c
==============================================================================
--- trunk/libnm-glib/nm-device-802-11-wireless.c	(original)
+++ trunk/libnm-glib/nm-device-802-11-wireless.c	Thu Jan 24 19:07:14 2008
@@ -190,6 +190,12 @@
 	NMDevice80211WirelessPrivate *priv = NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device);
 	NMAccessPoint *ap;
 
+	g_return_val_if_fail (path != NULL, NULL);
+
+	/* path of "/" means NULL */
+	if (!strcmp (path, "/"))
+		return NULL;
+
 	ap = g_hash_table_lookup (priv->aps, path);
 	if (!ap && create_if_not_found) {
 		ap = nm_access_point_new (nm_object_get_connection (NM_OBJECT (device)), path);
@@ -214,8 +220,7 @@
 		priv->current_ap = NULL;
 	}
 
-	/* ap_path of "/" means no AP */
-	if (ap_path && strcmp (ap_path, "/")) {
+	if (ap_path) {
 		priv->current_ap = get_access_point (self, ap_path, TRUE);
 		if (priv->current_ap)
 			g_object_ref (priv->current_ap);
@@ -330,7 +335,7 @@
 	NMAccessPoint *ap;
 
 	ap = get_access_point (device, path, TRUE);
-	if (device)
+	if (device && ap)
 		g_signal_emit (device, signals[ACCESS_POINT_ADDED], 0, ap);
 }
 
@@ -341,7 +346,7 @@
 	NMAccessPoint *ap;
 
 	ap = get_access_point (device, path, FALSE);
-	if (device) {
+	if (device && ap) {
 		g_signal_emit (device, signals[ACCESS_POINT_REMOVED], 0, ap);
 		g_hash_table_remove (NM_DEVICE_802_11_WIRELESS_GET_PRIVATE (device)->aps, path);
 	}



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