rpms/gnome-bluetooth/F-11 gbt-f11-backport.patch, NONE, 1.1 gnome-bluetooth.spec, 1.82, 1.83

Bastien Nocera hadess at fedoraproject.org
Wed Sep 16 11:02:20 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gnome-bluetooth/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25409

Modified Files:
	gnome-bluetooth.spec 
Added Files:
	gbt-f11-backport.patch 
Log Message:
* Wed Sep 16 2009 Bastien Nocera <bnocera at redhat.com> 2.27.8-2
- Backport loads of bug fixes from master (#523001)


gbt-f11-backport.patch:
 applet/main.c                    |   33 ++++++++++----
 b/applet/main.c                  |    4 -
 b/applet/notify.c                |    2 
 b/applet/popup-menu.ui           |    9 +++
 b/lib/bluetooth-client.c         |    5 +-
 b/lib/bluetooth-enums.h          |    7 ++-
 b/lib/bluetooth-plugin-manager.c |    5 +-
 b/lib/test-client.c              |   17 +++++--
 b/lib/test-plugins.c             |   12 ++++-
 b/properties/adapter.c           |    3 -
 b/properties/main.c              |    7 ++-
 b/wizard/main.c                  |    2 
 b/wizard/wizard.ui               |    3 -
 lib/bluetooth-client.c           |   91 ++++++++++++++++++++++++++-------------
 lib/bluetooth-enums.h            |   10 +---
 15 files changed, 145 insertions(+), 65 deletions(-)

--- NEW FILE gbt-f11-backport.patch ---
>From 20bc51c9b4bca1913f2dce4e897fe73e4bf4710e Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Fri, 24 Jul 2009 12:12:38 +0100
Subject: [PATCH 01/21] [Bug 589593] New: Crashes when disconnecting audio service

---
 lib/bluetooth-client.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index b087861..caae303 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1610,6 +1610,10 @@ service_to_index (const char *service)
 		if (g_str_equal (connectable_interfaces[i], service) != FALSE)
 			return i;
 	}
+	for (i = 0; i < G_N_ELEMENTS (detectable_interfaces); i++) {
+		if (g_str_equal (detectable_interfaces[i], service) != FALSE)
+			return i + G_N_ELEMENTS (connectable_interfaces);
+	}
 
 	g_assert_not_reached ();
 
-- 
1.6.2.5


>From ea8e00974c687eba2bf2b735245ea2a3b4d80af9 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Fri, 24 Jul 2009 13:37:05 +0100
Subject: [PATCH 02/21] Track the state of org.bluez.Audio service as well

Because otherwise we think it's still connected when it actually
isn't. Fixes the device showing up as connected when it wasn't
in BlueZ.
---
 lib/bluetooth-client.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index caae303..63582f1 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -61,6 +61,7 @@
 #define BLUEZ_DEVICE_INTERFACE	"org.bluez.Device"
 
 static char * detectable_interfaces[] = {
+	"org.bluez.Audio",
 	"org.bluez.Headset",
 	"org.bluez.AudioSink",
 	"org.bluez.Input"
@@ -349,22 +350,15 @@ device_list_nodes (DBusGProxy *device, BluetoothClient *client, gboolean connect
 	for (i = 0; i < G_N_ELEMENTS (detectable_interfaces); i++) {
 		DBusGProxy *iface;
 		GHashTable *props;
-		const char *iface_name;
 
 		/* Don't add the input interface for devices that already have
 		 * audio stuff */
 		if (g_str_equal (detectable_interfaces[i], BLUEZ_INPUT_INTERFACE)
 		    && g_hash_table_size (table) > 0)
 			continue;
-		/* Add org.bluez.Audio if the device supports headset or audiosink */
-		if (g_str_equal (detectable_interfaces[i], BLUEZ_HEADSET_INTERFACE) ||
-		    g_str_equal (detectable_interfaces[i], BLUEZ_AUDIOSINK_INTERFACE))
-		    	iface_name = BLUEZ_AUDIO_INTERFACE;
-		else
-			iface_name = detectable_interfaces[i];
 
 		/* And skip interface if it's already in the hash table */
-		if (g_hash_table_lookup (table, iface_name) != NULL)
+		if (g_hash_table_lookup (table, detectable_interfaces[i]) != NULL)
 			continue;
 
 		iface = dbus_g_proxy_new_from_proxy (device, detectable_interfaces[i], NULL);
@@ -386,7 +380,7 @@ device_list_nodes (DBusGProxy *device, BluetoothClient *client, gboolean connect
 				is_connected = (g_strcmp0(str, "connected") == 0);
 			}
 
-			g_hash_table_insert (table, (gpointer) iface_name, GINT_TO_POINTER (is_connected));
+			g_hash_table_insert (table, (gpointer) detectable_interfaces[i], GINT_TO_POINTER (is_connected));
 
 			if (connect_signal != FALSE) {
 				dbus_g_proxy_add_signal(iface, "PropertyChanged",
-- 
1.6.2.5


>From 050d5855db820dbaa9cc5000bb325d7f6d045f76 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Sun, 26 Jul 2009 16:11:54 +0100
Subject: [PATCH 03/21] Add status enumeration

To mark services as being connected, disconnected, or
connecting.
---
 lib/bluetooth-enums.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/bluetooth-enums.h b/lib/bluetooth-enums.h
index 7163607..3ec607a 100644
--- a/lib/bluetooth-enums.h
+++ b/lib/bluetooth-enums.h
@@ -79,6 +79,12 @@ typedef enum {
 	_BLUETOOTH_NUM_COLUMNS /*< skip >*/
 } BluetoothColumn;
 
+typedef enum {
+	BLUETOOTH_STATUS_DISCONNECTED = 0,
+	BLUETOOTH_STATUS_CONNECTED,
+	BLUETOOTH_STATUS_CONNECTING
+} BluetoothStatus;
+
 G_END_DECLS
 
 #endif /* __BLUETOOTH_ENUMS_H */
-- 
1.6.2.5


>From c7fc79a81d5397bbe171f547a38a6d7d606b3105 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Sun, 26 Jul 2009 16:12:46 +0100
Subject: [PATCH 04/21] Mark services as connecting

When the service supports it, mark them as "connecting" when
a connection is taking place. Only works for audio devices
right now.
---
 lib/bluetooth-client.c |   46 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 63582f1..d639ba6 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -34,6 +34,7 @@
 #include "bluetooth-client.h"
 #include "bluetooth-client-private.h"
 #include "bluetooth-client-glue.h"
+#include "gnome-bluetooth-enum-types.h"
 
 #include "marshal.h"
 
@@ -310,12 +311,24 @@ device_services_changed (DBusGProxy *iface, const char *property,
 	GtkTreePath *tree_path;
 	GHashTable *table;
 	const char *path;
-	gboolean is_connected;
+	BluetoothStatus status;
 
 	if (g_str_equal (property, "Connected") != FALSE) {
-		is_connected = g_value_get_boolean(value);
+		status = g_value_get_boolean (value) ?
+			BLUETOOTH_STATUS_CONNECTED :
+			BLUETOOTH_STATUS_DISCONNECTED;
 	} else if (g_str_equal (property, "State") != FALSE) {
-		is_connected = (g_strcmp0(g_value_get_string (value), "connected") == 0);
+		GEnumClass *eclass;
+		GEnumValue *ev;
+		eclass = g_type_class_ref (BLUETOOTH_TYPE_STATUS);
+		ev = g_enum_get_value_by_nick (eclass, g_value_get_string (value));
+		if (ev == NULL) {
+			g_warning ("Unknown status '%s'", g_value_get_string (value));
+			status = BLUETOOTH_STATUS_DISCONNECTED;
+		} else {
+			status = ev->value;
+		}
+		g_type_class_unref (eclass);
 	} else
 		return;
 
@@ -329,7 +342,7 @@ device_services_changed (DBusGProxy *iface, const char *property,
 
 	g_hash_table_insert (table,
 			     (gpointer) dbus_g_proxy_get_interface (iface),
-			     GINT_TO_POINTER (is_connected));
+			     GINT_TO_POINTER (status));
 
 	tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->store), &iter);
 	gtk_tree_model_row_changed (GTK_TREE_MODEL (priv->store), tree_path, &iter);
@@ -366,21 +379,30 @@ device_list_nodes (DBusGProxy *device, BluetoothClient *client, gboolean connect
 				       G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &props,
 				       G_TYPE_INVALID) != FALSE) {
 			GValue *value;
-			gboolean is_connected;
+			BluetoothStatus status;
 
 			value = g_hash_table_lookup(props, "Connected");
 			if (value != NULL) {
-				is_connected = g_value_get_boolean(value);
+				status = g_value_get_boolean(value) ?
+					BLUETOOTH_STATUS_CONNECTED :
+					BLUETOOTH_STATUS_DISCONNECTED;
 			} else {
-				const char *str = "disconnected";
-				value = g_hash_table_lookup(props, "State");
-				if (value != NULL)
-					str = g_value_get_string(value);
+				GEnumClass *eclass;
+				GEnumValue *ev;
 
-				is_connected = (g_strcmp0(str, "connected") == 0);
+				eclass = g_type_class_ref (BLUETOOTH_TYPE_STATUS);
+				value = g_hash_table_lookup(props, "State");
+				ev = g_enum_get_value_by_nick (eclass, g_value_get_string (value));
+				if (ev == NULL) {
+					g_warning ("Unknown status '%s'", g_value_get_string (value));
+					status = BLUETOOTH_STATUS_DISCONNECTED;
+				} else {
+					status = ev->value;
+				}
+				g_type_class_unref (eclass);
 			}
 
-			g_hash_table_insert (table, (gpointer) detectable_interfaces[i], GINT_TO_POINTER (is_connected));
+			g_hash_table_insert (table, (gpointer) detectable_interfaces[i], GINT_TO_POINTER (status));
 
 			if (connect_signal != FALSE) {
 				dbus_g_proxy_add_signal(iface, "PropertyChanged",
-- 
1.6.2.5


>From b60e246b68250058c6917d1f423349050fafcb70 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Sun, 26 Jul 2009 16:13:26 +0100
Subject: [PATCH 05/21] Update test client for status changes

The test client now knows whether a service is connecting.
---
 lib/test-client.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/test-client.c b/lib/test-client.c
index 57edcc2..56d5ebc 100644
--- a/lib/test-client.c
+++ b/lib/test-client.c
@@ -31,6 +31,7 @@
 
 #include "bluetooth-client.h"
 #include "bluetooth-client-private.h"
+#include "gnome-bluetooth-enum-types.h"
 
 static BluetoothClient *client;
 static GtkTreeSelection *selection;
@@ -98,10 +99,19 @@ static void type_to_text(GtkTreeViewColumn *column, GtkCellRenderer *cell,
 }
 
 static void
-services_foreach (const char *service, gpointer _value, GString *str)
+services_foreach (const char *service, gpointer value, GString *str)
 {
-	gboolean value = GPOINTER_TO_INT (_value);
-	g_string_append_printf (str, "%s (%s) ", service, value ? "connected" : "not connected");
+	GEnumClass *eclass;
+	GEnumValue *ev;
+	BluetoothStatus status = GPOINTER_TO_INT (value);
+
+	eclass = g_type_class_ref (BLUETOOTH_TYPE_STATUS);
+	ev = g_enum_get_value (eclass, status);
+	if (ev == NULL)
+		g_warning ("Unknown status value %d", status);
+
+	g_string_append_printf (str, "%s (%s) ", service, ev ? ev->value_nick : "unknown");
+	g_type_class_unref (eclass);
 }
 
 static void services_to_text(GtkTreeViewColumn *column, GtkCellRenderer *cell,
-- 
1.6.2.5


>From 4a30c0b7ab2695d2a6937d17097372e80d08de5c Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Sun, 26 Jul 2009 16:27:27 +0100
Subject: [PATCH 06/21] Fix small memleak when changing the tooltip

When changing the tooltip of the applet, don't forget to free
the old tooltip...
---
 applet/notify.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/applet/notify.c b/applet/notify.c
index f4dd3b5..e1f3ebc 100644
--- a/applet/notify.c
+++ b/applet/notify.c
@@ -149,6 +149,7 @@ void set_icon(gboolean enabled)
 
 	if (statusicon == NULL) {
 		g_free (icon_name);
+		g_free (tooltip);
 		icon_name = g_strdup (name);
 		tooltip = g_strdup (_tooltip);
 	} else {
-- 
1.6.2.5


>From 03bb5b2198c1e8ec0f52e1dc34e858378d5de668 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Sun, 26 Jul 2009 17:16:30 +0100
Subject: [PATCH 07/21] Add support for "playing" status

As used in the A2DP and Headset services.
---
 lib/bluetooth-enums.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/bluetooth-enums.h b/lib/bluetooth-enums.h
index 3ec607a..7563c4c 100644
--- a/lib/bluetooth-enums.h
+++ b/lib/bluetooth-enums.h
@@ -82,7 +82,8 @@ typedef enum {
 typedef enum {
 	BLUETOOTH_STATUS_DISCONNECTED = 0,
 	BLUETOOTH_STATUS_CONNECTED,
-	BLUETOOTH_STATUS_CONNECTING
+	BLUETOOTH_STATUS_CONNECTING,
+	BLUETOOTH_STATUS_PLAYING
 } BluetoothStatus;
 
 G_END_DECLS
-- 
1.6.2.5


>From 8110b166205759fc0e585573fe226373538df8ec Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Sun, 26 Jul 2009 20:43:52 +0100
Subject: [PATCH 08/21] =?utf-8?q?Bug=20589681=20=E2=80=93=20Doesn't=20connect=20to=20input=20service=20on=20Sony=20Ericsson=20phones?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Ignore the Audio service if there's no AudioSink or Headset service.

Makes the input service show up again for Sony Ericsson phones, and
allows us to connect to the remote control application.
---
 lib/bluetooth-client.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index d639ba6..e929ad4 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -62,9 +62,9 @@
 #define BLUEZ_DEVICE_INTERFACE	"org.bluez.Device"
 
 static char * detectable_interfaces[] = {
-	"org.bluez.Audio",
 	"org.bluez.Headset",
 	"org.bluez.AudioSink",
+	"org.bluez.Audio",
 	"org.bluez.Input"
 };
 
@@ -370,6 +370,15 @@ device_list_nodes (DBusGProxy *device, BluetoothClient *client, gboolean connect
 		    && g_hash_table_size (table) > 0)
 			continue;
 
+		/* Don't add the audio interface if there's no Headset or AudioSink,
+		 * that means that it could only receive audio */
+		if (g_str_equal (detectable_interfaces[i], BLUEZ_AUDIO_INTERFACE)) {
+			if (g_hash_table_lookup (table, BLUEZ_HEADSET_INTERFACE) == NULL &&
+			    g_hash_table_lookup (table, BLUEZ_AUDIOSINK_INTERFACE) == NULL) {
+				continue;
+			}
+		}
+
 		/* And skip interface if it's already in the hash table */
 		if (g_hash_table_lookup (table, detectable_interfaces[i]) != NULL)
 			continue;
-- 
1.6.2.5


>From f2ae6aa239df221ca096cdb604f0569218d6178a Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 30 Jul 2009 15:50:22 +0100
Subject: [PATCH 09/21] Fix thinko in disabling menu items

---
 applet/main.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/applet/main.c b/applet/main.c
index c826b9d..f9ea351 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -350,8 +350,7 @@ update_menu_items (void)
 	if (num_adapters_present == 0)
 		enabled = FALSE;
 	else
-		enabled = (num_adapters_present - num_adapters_powered) >= 0;
-
+		enabled = (num_adapters_present - num_adapters_powered) <= 0;
 
 	object = gtk_builder_get_object (xml, "send-file");
 	gtk_action_set_sensitive (GTK_ACTION (object),
-- 
1.6.2.5


>From fbd08ce783b8d25514e6436d05865267385c6834 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 30 Jul 2009 16:02:08 +0100
Subject: [PATCH 10/21] Print out errors when GtkBuilder files fail parsing

---
 applet/main.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/applet/main.c b/applet/main.c
index f9ea351..c849e17 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -309,10 +309,23 @@ killswitch_state_changed (BluetoothKillswitch *killswitch, KillswitchState state
 static GtkWidget *create_popupmenu(void)
 {
 	GObject *object;
+	GError *error = NULL;
 
 	xml = gtk_builder_new ();
-	if (gtk_builder_add_from_file (xml, "popup-menu.ui", NULL) == 0)
-		gtk_builder_add_from_file (xml, PKGDATADIR "/popup-menu.ui", NULL);
+	if (gtk_builder_add_from_file (xml, "popup-menu.ui", &error) == 0) {
+		if (error->domain == GTK_BUILDER_ERROR) {
+			g_warning ("Failed to load popup-menu.ui: %s", error->message);
+			g_error_free (error);
+			return NULL;
+		}
+		g_error_free (error);
+		error = NULL;
+		if (gtk_builder_add_from_file (xml, PKGDATADIR "/popup-menu.ui", &error) == 0) {
+			g_warning ("Failed to load popup-menu.ui: %s", error->message);
+			g_error_free (error);
+			return NULL;
+		}
+	}
 
 	gtk_builder_connect_signals (xml, NULL);
 
-- 
1.6.2.5


>From df5c7c34bc948bfb1a81fe21fdd417365eba7ae0 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 30 Jul 2009 18:10:41 +0100
Subject: [PATCH 11/21] Update default-adapter-powered when no adapters are available

Otherwise we might think it's still enabled when it's not.
---
 lib/bluetooth-client.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index e929ad4..52a7481 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -970,7 +970,9 @@ static void adapter_removed(DBusGProxy *manager,
 	if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL(priv->store), NULL) == 0) {
 		g_free(priv->default_adapter);
 		priv->default_adapter = NULL;
+		priv->default_adapter_powered = FALSE;
 		g_object_notify (G_OBJECT (client), "default-adapter");
+		g_object_notify (G_OBJECT (client), "default-adapter-powered");
 	}
 }
 
-- 
1.6.2.5


>From e0f2fbece374182b30e6375eee04b76cb6ddf87b Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 30 Jul 2009 18:26:05 +0100
Subject: [PATCH 12/21] Update the Powered column on adapter changes

Otherwise we miss the adapter going down on soft block rfkill.
---
 lib/bluetooth-client.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 52a7481..c56cc8e 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -825,6 +825,18 @@ static void adapter_changed(DBusGProxy *adapter, const char *property,
 		gtk_tree_store_set(priv->store, &iter,
 				BLUETOOTH_COLUMN_DISCOVERING, discovering, -1);
 		notify = TRUE;
+	} else if (g_str_equal(property, "Powered") == TRUE) {
+		gboolean powered = g_value_get_boolean(value);
+		gboolean is_default;
+
+		gtk_tree_store_set(priv->store, &iter,
+				   BLUETOOTH_COLUMN_POWERED, powered, -1);
+		gtk_tree_model_get(GTK_TREE_MODEL(priv->store), &iter,
+				   BLUETOOTH_COLUMN_DEFAULT, &is_default, -1);
+		if (is_default != FALSE && powered != priv->default_adapter_powered) {
+			priv->default_adapter_powered = powered;
+			g_object_notify (G_OBJECT (client), "default-adapter-powered");
+		}
 	}
 
 	if (notify != FALSE) {
-- 
1.6.2.5


>From b83c15e7c2ac8c24516fa97bc26a13eb40c40331 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 30 Jul 2009 18:30:00 +0100
Subject: [PATCH 13/21] Hide unwanted menu items when Bluetooth is disabled

We don't care about much of the menu items when there's no
adapters enabled.
---
 applet/main.c        |   15 +++++++++------
 applet/popup-menu.ui |    8 ++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/applet/main.c b/applet/main.c
index c849e17..e9b077d 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -365,18 +365,21 @@ update_menu_items (void)
 	else
 		enabled = (num_adapters_present - num_adapters_powered) <= 0;
 
+	object = gtk_builder_get_object (xml, "adapter-action-group");
+	gtk_action_group_set_visible (GTK_ACTION_GROUP (object), enabled);
+	gtk_action_group_set_visible (devices_action_group, enabled);
+
+	if (enabled == FALSE)
+		return;
+
 	object = gtk_builder_get_object (xml, "send-file");
 	gtk_action_set_sensitive (GTK_ACTION (object),
-				  enabled &&
-				  (program_available ("obex-data-server")
-				   || program_available ("obexd")));
+				  program_available ("obexd"));
 
 	object = gtk_builder_get_object (xml, "browse-device");
 	gtk_action_set_sensitive (GTK_ACTION (object),
-				  enabled && program_available ("nautilus"));
+				  program_available ("nautilus"));
 
-	object = gtk_builder_get_object (xml, "setup-new");
-	gtk_action_set_sensitive (GTK_ACTION (object), enabled);
 }
 
 static void
diff --git a/applet/popup-menu.ui b/applet/popup-menu.ui
index 0060ae4..a4677b0 100644
--- a/applet/popup-menu.ui
+++ b/applet/popup-menu.ui
@@ -20,6 +20,10 @@
 						<signal name="activate" handler="bluetooth_status_callback"/>
 					</object>
 				</child>
+			</object>
+		</child>
+		<child>
+			<object class="GtkActionGroup" id="adapter-action-group">
 				<child>
 					<object class="GtkAction" id="send-file">
 						<property name="label" translatable="yes">Send files to device...</property>
@@ -46,6 +50,10 @@
 						<signal name="activate" handler="wizard_callback"/>
 					</object>
 				</child>
+			</object>
+		</child>
+		<child>
+			<object class="GtkActionGroup" id="preferences-action-group">
 				<child>
 					<object class="GtkAction" id="preferences">
 						<property name="label" translatable="yes">Preferences...</property>
-- 
1.6.2.5


>From e1570bfc65aa2d26d7ca117a0b3e1a81f85d2d62 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Mon, 3 Aug 2009 15:55:48 +0100
Subject: [PATCH 14/21] Fix underline in "Set up new device"

Spotted by Matthias Clasen
---
 properties/adapter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/properties/adapter.c b/properties/adapter.c
index 122df2b..8b6a7db 100644
--- a/properties/adapter.c
+++ b/properties/adapter.c
@@ -434,7 +434,7 @@ static void create_adapter(adapter_data *adapter)
 	gtk_table_attach(GTK_TABLE(table), buttonbox, 1, 2, 1, 2,
 			 GTK_FILL, GTK_FILL, 6, 6);
 
-	button = gtk_button_new_with_label(_("Setup _new device..."));
+	button = gtk_button_new_with_mnemonic(_("Setup _new device..."));
 	image = gtk_image_new_from_stock(GTK_STOCK_ADD,
 						GTK_ICON_SIZE_BUTTON);
 	gtk_button_set_image(GTK_BUTTON(button), image);
-- 
1.6.2.5


>From abbe0a406ef3fb510d87580e96d2457d74f7b10b Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Tue, 11 Aug 2009 09:40:45 +0100
Subject: [PATCH 15/21] =?utf-8?q?Bug=20590874=20=E2=80=93=20crash=20in=20Bluetooth:=20adding=20a=20bluetooth=20NAP=20phone?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Don't unload plugins, fixes crashes on exit when the plugins
register GObject types.
---
 lib/bluetooth-plugin-manager.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/bluetooth-plugin-manager.c b/lib/bluetooth-plugin-manager.c
index c8db9ef..ab1751c 100644
--- a/lib/bluetooth-plugin-manager.c
+++ b/lib/bluetooth-plugin-manager.c
@@ -101,7 +101,9 @@ bluetooth_plugin_manager_cleanup (void)
 	for (l = plugin_list; l != NULL; l = l->next) {
 		GbtPlugin *p = l->data;
 
-		g_module_close (p->module);
+		/* Disabled as it causes crashes when plugins use
+		 * the GObject type system */
+		/* g_module_close (p->module); */
 		g_free (p);
 	}
 	g_list_free (plugin_list);
-- 
1.6.2.5


>From fa90cb5852bcad75835d733613114355095005b2 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Tue, 11 Aug 2009 11:50:38 +0100
Subject: [PATCH 16/21] Add D-Bus object path to the debug output

---
 properties/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/properties/main.c b/properties/main.c
index da60ff5..535dfef 100644
--- a/properties/main.c
+++ b/properties/main.c
@@ -212,6 +212,7 @@ services_foreach (const char *service, gpointer _value, GString *str)
 static void
 dump_device (GtkTreeModel *model, GtkTreeIter *iter, gboolean is_adapter)
 {
+	DBusGProxy *proxy;
 	char *address, *alias, *icon, **uuids;
 	gboolean is_default, paired, trusted, connected, discovering, powered;
 	GHashTable *services;
@@ -230,11 +231,12 @@ dump_device (GtkTreeModel *model, GtkTreeIter *iter, gboolean is_adapter)
 			    BLUETOOTH_COLUMN_POWERED, &powered,
 			    BLUETOOTH_COLUMN_SERVICES, &services,
 			    BLUETOOTH_COLUMN_UUIDS, &uuids,
+			    BLUETOOTH_COLUMN_PROXY, &proxy,
 			    -1);
 
 	if (is_adapter != FALSE) {
 		/* Adapter */
-		g_print ("Adapter: %s (%s)\n", alias, address);
+		g_print ("Adapter: %s (%s)\n", alias ? alias : "(No alias)", address);
 		if (is_default)
 			g_print ("\tDefault adapter\n");
 		if (discovering)
@@ -243,6 +245,7 @@ dump_device (GtkTreeModel *model, GtkTreeIter *iter, gboolean is_adapter)
 	} else {
 		/* Device */
 		g_print ("Device: %s (%s)\n", alias, address);
+		g_print ("\tD-Bus Path: %s\n", proxy ? dbus_g_proxy_get_path (proxy) : "(none)");
 		g_print ("\tType: %s Icon: %s\n", bluetooth_type_to_string (type), icon);
 		g_print ("\tPaired: %s Trusted: %s Connected: %s\n", BOOL_STR(paired), BOOL_STR(trusted), BOOL_STR(connected));
 		if (services != NULL) {
@@ -266,6 +269,7 @@ dump_device (GtkTreeModel *model, GtkTreeIter *iter, gboolean is_adapter)
 	g_free (alias);
 	g_free (address);
 	g_free (icon);
+	g_object_unref (proxy);
 	if (services != NULL)
 		g_hash_table_unref (services);
 	g_strfreev (uuids);
-- 
1.6.2.5


>From eb1d160df6df18e40e096e0a340bc097603f2071 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Mon, 10 Aug 2009 11:20:37 +0100
Subject: [PATCH 17/21] Handle delete-event in test-plugins

So we can have it exit cleanly for use with valgrind.
---
 lib/test-plugins.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lib/test-plugins.c b/lib/test-plugins.c
index ce4009b..ac06084 100644
--- a/lib/test-plugins.c
+++ b/lib/test-plugins.c
@@ -2,6 +2,15 @@
 #include <dbus/dbus-glib.h>
 #include "bluetooth-plugin-manager.h"
 
+static gboolean
+delete_event_cb (GtkWidget *widget,
+		 GdkEvent  *event,
+		 gpointer   user_data)
+{
+	gtk_main_quit ();
+	return FALSE;
+}
+
 int main (int argc, char **argv)
 {
 	GtkWidget *window, *vbox;
@@ -18,6 +27,8 @@ int main (int argc, char **argv)
 	bluetooth_plugin_manager_init ();
 
 	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+	g_signal_connect (G_OBJECT (window), "delete-event",
+			  G_CALLBACK (delete_event_cb), NULL);
 	vbox = gtk_vbox_new (FALSE, 6);
 	gtk_container_add (GTK_CONTAINER (window), vbox);
 
-- 
1.6.2.5


>From bd1d8b99462098c03a1ec0f6ebae04c09f772575 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Tue, 1 Sep 2009 17:45:01 +0100
Subject: [PATCH 18/21] =?utf-8?q?Bug=C2=A0593777=20-=20duplicate=20object=20id=20in=20ui=20file?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Rename duplicate label1 to label3 (which is unused)
---
 wizard/wizard.ui |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/wizard/wizard.ui b/wizard/wizard.ui
index 459f8b2..6b03cfc 100644
--- a/wizard/wizard.ui
+++ b/wizard/wizard.ui
@@ -390,7 +390,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label1">
+              <object class="GtkLabel" id="label3">
                 <property name="visible">True</property>
                 <property name="xalign">0</property>
                 <property name="label" translatable="yes">Fixed PIN</property>
-- 
1.6.2.5


>From 22484ca7b5d2f7c2f12fbf3423b3ad93f354e407 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 3 Sep 2009 18:17:43 +0100
Subject: [PATCH 19/21] =?utf-8?q?Bug=C2=A0594055=20-=20applet=20fails=20to=20connect=20to=20any=20disconnected=20audio=20device?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Hunted down by Peter Hurley <phurley at charter.net>.

Description
If the remote device is disconnected when the applet starts, the applet
will be unable to initiate connection to the audio interface of the
device.

Cause
Incorrect use of g_hash_table_lookup in the device_list_nodes() function
in lib/bluetooth-client.c

Discussion
For a given device, device_list_nodes() loops through the known
detectable interfaces (those in detectable_interfaces[]) and adds
them to the returned hash table if calling the interfaces's
.GetProperties dbus method returns true.

The value of the "Connected" property is then stored as the associated
value with the interface name as the key in the hash table.

The *connectable* interface "org.bluez.Audio" is only added if at least
either of the *detectable* interfaces "org.bluez.Headset" or
"org.bluez.AudioSink" were added the the hash table in previous
iterations within device_list_nodes().

However, the test for whether those *detectable* interfaces were added
is not correct. Currently, g_hash_table_lookup() is used to determine
if the interface names are in the hash table.  g_hash_table_lookup()
will return NULL if the the key is not present in the hash table,
OTHERWISE IT RETURNS THE VALUE ASSOCIATED WITH THE KEY. If that value
is 0 (== BLUETOOTH_STATUS_DISCONNECTED), the logic mistakenly believes
that the key is not present in the hash table, and as a result, fails
to add the only connectable audio interface "org.bluez.Audio".

Recommend
Either use g_hash_table_lookup_extended() to test for key presence
or change enum BLUET00TH_STATUS_DISCONNECTED to be != 0.
---
 lib/bluetooth-enums.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/bluetooth-enums.h b/lib/bluetooth-enums.h
index 7563c4c..450c38c 100644
--- a/lib/bluetooth-enums.h
+++ b/lib/bluetooth-enums.h
@@ -80,7 +80,8 @@ typedef enum {
 } BluetoothColumn;
 
 typedef enum {
-	BLUETOOTH_STATUS_DISCONNECTED = 0,
+	BLUETOOTH_STATUS_INVALID = 0,
+	BLUETOOTH_STATUS_DISCONNECTED,
 	BLUETOOTH_STATUS_CONNECTED,
 	BLUETOOTH_STATUS_CONNECTING,
 	BLUETOOTH_STATUS_PLAYING
-- 
1.6.2.5


>From 016e07941e3fac523f339f144aad0880118ccf36 Mon Sep 17 00:00:00 2001
From: Stanislav Brabec <sbrabec at suse.cz>
Date: Thu, 10 Sep 2009 16:20:35 +0100
Subject: [PATCH 20/21] Fix crash on pairing request of known rfcomm device

Fixes crash after access attempt to the device configured
in rfcomm.conf, but not yet paired.

How to reproduce:

1. Configure an unknown RFCOMM device that requires authentication in
   rfcomm.conf (e. g. mobile phone).
2. run pppd on /dev/rfcomm1

Behavior:
- Pairing request on mobile phone
- Crash of bluetooth-applet on desktop
---
 lib/bluetooth-client.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index c56cc8e..d7fef54 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -663,7 +663,7 @@ static void add_device(DBusGProxy *adapter, GtkTreeIter *parent,
 		name = value ? g_value_get_string(value) : NULL;
 
 		value = g_hash_table_lookup(hash, "Class");
-		type = class_to_type(g_value_get_uint(value));
+		type = value ? class_to_type(g_value_get_uint(value)) : BLUETOOTH_TYPE_ANY;
 
 		value = g_hash_table_lookup(hash, "Icon");
 		icon = value ? g_value_get_string(value) : "bluetooth";
-- 
1.6.2.5


>From d326df2d5b7f78222f70fb805c13ff0a54917535 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Fri, 11 Sep 2009 14:58:25 +0100
Subject: [PATCH 21/21] Fix pairing with devices that require PIN entry

If a device that has a fixed PIN was selected before a device that
doesn't have one (for example, select a printer or audio headset,
before selecting a phone), then the automatic_pincode would have
been TRUE.

We need to reset the automatic_pincode every time we change devices.
---
 wizard/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/wizard/main.c b/wizard/main.c
index 4fde0de..31e10f7 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -771,6 +771,7 @@ select_device_changed (BluetoothChooser *selector,
 
 	target_type = type;
 	target_ssp = !legacypairing;
+	automatic_pincode = FALSE;
 
 	g_free (pincode);
 	pincode = NULL;
-- 
1.6.2.5



Index: gnome-bluetooth.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-bluetooth/F-11/gnome-bluetooth.spec,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -p -r1.82 -r1.83
--- gnome-bluetooth.spec	21 Jul 2009 16:34:17 -0000	1.82
+++ gnome-bluetooth.spec	16 Sep 2009 11:02:18 -0000	1.83
@@ -1,12 +1,14 @@
 Name:		gnome-bluetooth
 Version:	2.27.8
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Bluetooth graphical utilities
 
 Group:		Applications/Communications
 License:	GPLv2+
 URL:		http://live.gnome.org/GnomeBluetooth
 Source0:	http://download.gnome.org/sources/gnome-bluetooth/2.27/gnome-bluetooth-%{version}.tar.bz2
+# http://git.gnome.org/cgit/gnome-bluetooth/log/?h=fedora-11
+Patch0:		gbt-f11-backport.patch
 BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 BuildRequires:	gtk2-devel
@@ -62,6 +64,7 @@ for writing applications that require a 
 
 %prep
 %setup -q -n gnome-bluetooth-%{version}
+%patch0 -p1 -b .backport
 
 %build
 %configure --disable-desktop-update --disable-icon-update
@@ -185,6 +188,9 @@ fi
 %{_datadir}/gtk-doc/html/gnome-bluetooth/
 
 %changelog
+* Wed Sep 16 2009 Bastien Nocera <bnocera at redhat.com> 2.27.8-2
+- Backport loads of bug fixes from master (#523001)
+
 * Tue Jul 21 2009 Bastien Nocera <bnocera at redhat.com> 2.27.8-1
 - Update to 2.27.8
 




More information about the fedora-extras-commits mailing list