gnome-main-menu r464 - in trunk: . main-menu/src



Author: federico
Date: Tue May 13 23:18:38 2008
New Revision: 464
URL: http://svn.gnome.org/viewvc/gnome-main-menu?rev=464&view=rev

Log:
bnc375639 - Show the correct wireless SSID
2008-05-09  Magnus Boman  <captain magnus gmail com>

        https://bugzilla.novell.com/show_bug.cgi?id=375639
        Display active ap instead of the first ap in the list.

        * main-menu/src/network-status-agent.c (nm_get_device_info):
        Make sure we show ssid from an active ap by using
        nm_device_802_11_wireless_get_active_access_point.

Signed-off-by: Federico Mena Quintero <federico gnu org>


Modified:
   trunk/ChangeLog
   trunk/main-menu/src/network-status-agent.c

Modified: trunk/main-menu/src/network-status-agent.c
==============================================================================
--- trunk/main-menu/src/network-status-agent.c	(original)
+++ trunk/main-menu/src/network-status-agent.c	Tue May 13 23:18:38 2008
@@ -235,23 +235,23 @@
 
 	if (NM_IS_DEVICE_802_11_WIRELESS(device))
 	{
-		const GPtrArray *aps;
-		gint i;
-		info->type = DEVICE_TYPE_802_11_WIRELESS;
+		NMAccessPoint * activeap = NULL;
+		const GByteArray * ssid;
 
+		info->type = DEVICE_TYPE_802_11_WIRELESS;
 		info->speed_mbs = nm_device_802_11_wireless_get_bitrate (NM_DEVICE_802_11_WIRELESS(device));
 		info->hw_addr = g_strdup (nm_device_802_11_wireless_get_hw_address (NM_DEVICE_802_11_WIRELESS(device)));
-		aps = nm_device_802_11_wireless_get_access_points (NM_DEVICE_802_11_WIRELESS(device));
-		for (i = 0; aps && i < aps->len; i++)
+
+		activeap = nm_device_802_11_wireless_get_active_access_point (NM_DEVICE_802_11_WIRELESS(device));
+		if (activeap)
 		{
-			const GByteArray * ssid;
-			ssid = nm_access_point_get_ssid (NM_ACCESS_POINT (g_ptr_array_index (aps, i)));
+			ssid = nm_access_point_get_ssid (NM_ACCESS_POINT (activeap));
 			if (ssid)
 				info->essid = g_strdup (nm_utils_escape_ssid (ssid->data, ssid->len));
-			else
-				info->essid = g_strdup ("(none)");
-			break; //fixme - we only show one for now
 		}
+
+		if (! info->essid)
+			info->essid = g_strdup ("(none)");
 	}
 	else if (NM_IS_DEVICE_802_3_ETHERNET (device))
 	{



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