summaryrefslogtreecommitdiff
path: root/sendto
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2013-05-20 10:46:46 +0200
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2013-05-30 15:04:41 +0200
commit3649b96822164d92f1b7029a046676ffb61051bb (patch)
tree1c2a20b2aa8fb8978e2d2890bab4750d5f75f9dc /sendto
parent76c9733cacba3194dfd6aab3cdcf8779a7d530c0 (diff)
downloadgnome-bluetooth-3649b96822164d92f1b7029a046676ffb61051bb.tar.gz
sendto: check if we could create the proxy
https://bugzilla.gnome.org/show_bug.cgi?id=685717
Diffstat (limited to 'sendto')
-rw-r--r--sendto/main.c23
1 files changed, 14 insertions, 9 deletions
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();