[gnome-bluetooth] sendto: check if we could create the proxy



commit 3649b96822164d92f1b7029a046676ffb61051bb
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon May 20 10:46:46 2013 +0200

    sendto: check if we could create the proxy
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685717

 sendto/main.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/sendto/main.c b/sendto/main.c
index 57fdf18..b079fad 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -889,13 +889,6 @@ int main(int argc, char *argv[])
                return 1;
        }
 
-       if (option_device_name == NULL)
-               option_device_name = get_device_name(option_device);
-       if (option_device_name == NULL)
-               option_device_name = g_strdup(option_device);
-
-       create_window();
-
        client_proxy = g_dbus_proxy_new_sync (conn,
                                              G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | 
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
                                              NULL,
@@ -903,9 +896,21 @@ int main(int argc, char *argv[])
                                              OBEX_PATH,
                                              CLIENT_IFACE,
                                              cancellable,
-                                             NULL);
+                                             &error);
+       if (client_proxy == NULL) {
+               g_printerr("Acquiring proxy failed: %s\n", error->message);
+               g_error_free (error);
+               return 1;
+       }
+
+       if (option_device_name == NULL)
+               option_device_name = get_device_name(option_device);
+       if (option_device_name == NULL)
+               option_device_name = g_strdup(option_device);
+
+       create_window();
 
-       if (client_proxy)
+       if (!g_cancellable_is_cancelled (cancellable))
                send_files ();
 
        gtk_main();


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