[gnome-bluetooth] wizard: Update for the new connect API
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] wizard: Update for the new connect API
- Date: Tue, 18 Oct 2011 15:56:11 +0000 (UTC)
commit 5a0b12bee2d342dba8bffc04ba7ee7bf112787d2
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 18 15:53:27 2011 +0100
wizard: Update for the new connect API
wizard/main.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index 812a377..2b55f69 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -339,15 +339,17 @@ typedef struct {
} ConnectData;
static void
-connect_callback (BluetoothClient *_client,
- gboolean success,
- gpointer user_data)
+connect_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
ConnectData *data = (ConnectData *) user_data;
+ gboolean success;
+
+ success = bluetooth_client_connect_service_finish (client, res, NULL);
if (success == FALSE && g_timer_elapsed (data->timer, NULL) < CONNECT_TIMEOUT) {
- if (bluetooth_client_connect_service(client, data->path, connect_callback, data) != FALSE)
- return;
+ bluetooth_client_connect_service (client, data->path, TRUE, NULL, connect_callback, data);
}
if (success == FALSE)
@@ -394,14 +396,8 @@ create_callback (BluetoothClient *_client,
data->path = g_strdup (path);
data->timer = g_timer_new ();
- if (bluetooth_client_connect_service(client, path, connect_callback, data) != FALSE) {
- gtk_assistant_set_current_page (window_assistant, PAGE_FINISHING);
- } else {
- gtk_assistant_set_current_page (window_assistant, PAGE_SUMMARY);
- g_timer_destroy (data->timer);
- g_free (data->path);
- g_free (data);
- }
+ bluetooth_client_connect_service (client, path, TRUE, NULL, connect_callback, data);
+ gtk_assistant_set_current_page (window_assistant, PAGE_FINISHING);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]