[gnome-bluetooth] applet: Fix the Bluetooth status icon not appearing



commit 914c4868e3b896bb3580ba6a7abd93fb0dff3004
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Sep 21 16:32:36 2013 +0200

    applet: Fix the Bluetooth status icon not appearing
    
    Port the "connected" and "connectable" statuses to
    BlueZ 5/GNOME 3.10. The underlying API was changed, but
    our code wasn't.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708479

 applet/bluetooth-applet.c |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)
---
diff --git a/applet/bluetooth-applet.c b/applet/bluetooth-applet.c
index ca45976..a71fbff 100644
--- a/applet/bluetooth-applet.c
+++ b/applet/bluetooth-applet.c
@@ -806,7 +806,6 @@ bluetooth_applet_create_device_from_iter (GtkTreeModel *model,
                                          gboolean      check_proxy)
 {
        BluetoothSimpleDevice *dev;
-       GHashTable *services;
        GDBusProxy *proxy;
        char **uuids;
 
@@ -815,9 +814,9 @@ bluetooth_applet_create_device_from_iter (GtkTreeModel *model,
        gtk_tree_model_get (model, iter,
                            BLUETOOTH_COLUMN_ADDRESS, &dev->bdaddr,
                            BLUETOOTH_COLUMN_PROXY, &proxy,
-                           BLUETOOTH_COLUMN_SERVICES, &services,
                            BLUETOOTH_COLUMN_ALIAS, &dev->alias,
                            BLUETOOTH_COLUMN_UUIDS, &uuids,
+                           BLUETOOTH_COLUMN_CONNECTED, &dev->connected,
                            BLUETOOTH_COLUMN_TYPE, &dev->type,
                            -1);
 
@@ -826,8 +825,6 @@ bluetooth_applet_create_device_from_iter (GtkTreeModel *model,
                if (proxy != NULL)
                        g_object_unref (proxy);
                g_strfreev (uuids);
-               if (services != NULL)
-                       g_hash_table_unref (services);
                bluetooth_simple_device_free (dev);
 
                return NULL;
@@ -838,31 +835,12 @@ bluetooth_applet_create_device_from_iter (GtkTreeModel *model,
                g_object_unref (proxy);
        }
 
-       /* If one service is connected, then we're connected */
-       dev->connected = FALSE;
-       dev->can_connect = FALSE;
-       if (services != NULL) {
-               GList *list, *l;
-
-               dev->can_connect = TRUE;
-               list = g_hash_table_get_values (services);
-               for (l = list; l != NULL; l = l->next) {
-                       BluetoothStatus val = GPOINTER_TO_INT (l->data);
-                       if (val == BLUETOOTH_STATUS_CONNECTED ||
-                           val == BLUETOOTH_STATUS_PLAYING) {
-                               dev->connected = TRUE;
-                               break;
-                       }
-               }
-               g_list_free (list);
-       }
+       dev->can_connect = bluetooth_client_get_connectable ((const char **) uuids);
 
        dev->capabilities = 0;
        dev->capabilities |= device_has_uuid ((const char **) uuids, "OBEXObjectPush") ? 
BLUETOOTH_CAPABILITIES_OBEX_PUSH : 0;
        dev->capabilities |= device_has_uuid ((const char **) uuids, "OBEXFileTransfer") ? 
BLUETOOTH_CAPABILITIES_OBEX_FILE_TRANSFER : 0;
 
-       if (services != NULL)
-               g_hash_table_unref (services);
        g_strfreev (uuids);
 
        return dev;


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