[gnome-bluetooth] applet: Only show "Devices" section if we have devices



commit 4aa6b5562ee8c255c4bf9ac2a6c4fd8dfe1e7836
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 27 20:36:49 2010 +0100

    applet: Only show "Devices" section if we have devices
    
    If the devices are rejected by device_has_submenu(), then
    we shouldn't show the "Devices" section at all.

 applet/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/applet/main.c b/applet/main.c
index 85f9b92..6c404f4 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -748,7 +748,7 @@ update_device_list (BluetoothApplet *applet,
 {
 	GtkUIManager *uimanager;
 	GList *actions, *devices, *l;
-	gboolean has_devices = TRUE;
+	gboolean has_devices = FALSE;
 
 	uimanager = GTK_UI_MANAGER (gtk_builder_get_object (xml, "bluetooth-applet-ui-manager"));
 
@@ -759,7 +759,6 @@ update_device_list (BluetoothApplet *applet,
 		actions = gtk_action_group_list_actions (devices_action_group);
 		g_list_foreach (actions, (GFunc) remove_action_item, uimanager);
 		g_list_free (actions);
-		has_devices = FALSE;
 		goto done;
 	}
 
@@ -782,6 +781,8 @@ update_device_list (BluetoothApplet *applet,
 			continue;
 		}
 
+		has_devices = TRUE;
+
 		action = gtk_action_group_get_action (devices_action_group, device->bdaddr);
 		oper = NULL;
 		status = NULL;



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