[gnome-bluetooth] properties: Update for the new connect API
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] properties: Update for the new connect API
- Date: Tue, 18 Oct 2011 15:56:06 +0000 (UTC)
commit 3aef7a40d36527ec7c6ac3a6ea621706b2fb2ce5
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 18 15:53:18 2011 +0100
properties: Update for the new connect API
properties/cc-bluetooth-panel.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/properties/cc-bluetooth-panel.c b/properties/cc-bluetooth-panel.c
index 7e7c538..7bc7052 100644
--- a/properties/cc-bluetooth-panel.c
+++ b/properties/cc-bluetooth-panel.c
@@ -32,7 +32,6 @@
#include <bluetooth-client.h>
#include <bluetooth-utils.h>
-#include <bluetooth-client-private.h>
#include <bluetooth-killswitch.h>
#include <bluetooth-chooser.h>
#include <bluetooth-chooser-private.h>
@@ -115,12 +114,17 @@ typedef struct {
} ConnectData;
static void
-connect_done (BluetoothClient *client,
- gboolean success,
- ConnectData *data)
+connect_done (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
CcBluetoothPanel *self;
char *bdaddr;
+ gboolean success;
+ ConnectData *data = (ConnectData *) user_data;
+
+ success = bluetooth_client_connect_service_finish (BLUETOOTH_CLIENT (source_object),
+ res, NULL);
self = data->self;
@@ -166,13 +170,12 @@ switch_connected_active_changed (GtkSwitch *button,
data->bdaddr = bluetooth_chooser_get_selected_device (BLUETOOTH_CHOOSER (self->priv->chooser));
data->self = g_object_ref (self);
- if (gtk_switch_get_active (button)) {
- bluetooth_client_connect_service (self->priv->client, proxy,
- (BluetoothClientConnectFunc) connect_done, data);
- } else {
- bluetooth_client_disconnect_service (self->priv->client, proxy,
- (BluetoothClientConnectFunc) connect_done, data);
- }
+ bluetooth_client_connect_service (self->priv->client,
+ proxy,
+ gtk_switch_get_active (button),
+ NULL,
+ connect_done,
+ data);
/* FIXME: make a note somewhere that the button for that
* device should be disabled */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]