From 4c2f6219a9ede43afe29b64935e3d5b7c5577643 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 24 Jan 2008 19:07:14 +0000 Subject: [PATCH] 2008-01-24 Dan Williams * 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 git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3269 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 10 ++++++++++ libnm-glib/nm-device-802-11-wireless.c | 13 +++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9e9e7aaa9..edf3ddfc17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-01-24 Dan Williams + + * 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 + 2008-01-24 Dan Williams * libnm-glib/nm-device-802-11-wireless.c diff --git a/libnm-glib/nm-device-802-11-wireless.c b/libnm-glib/nm-device-802-11-wireless.c index 04e6c61378..de3e913bf5 100644 --- a/libnm-glib/nm-device-802-11-wireless.c +++ b/libnm-glib/nm-device-802-11-wireless.c @@ -190,6 +190,12 @@ get_access_point (NMDevice80211Wireless *device, const char *path, gboolean crea 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 @@ nm_device_802_11_wireless_set_active_ap (NMDevice80211Wireless *self, 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 @@ access_point_added_proxy (DBusGProxy *proxy, char *path, gpointer user_data) 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 @@ access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data) 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); }