From 3649b96822164d92f1b7029a046676ffb61051bb Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Mon, 20 May 2013 10:46:46 +0200 Subject: sendto: check if we could create the proxy https://bugzilla.gnome.org/show_bug.cgi?id=685717 --- sendto/main.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'sendto') diff --git a/sendto/main.c b/sendto/main.c index 57fdf186..b079fad2 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(); -- cgit v1.2.1