[gnome-bluetooth] Don't hang when querying for the transfer properties
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-bluetooth] Don't hang when querying for the transfer properties
- Date: Wed, 10 Jun 2009 19:44:52 -0400 (EDT)
commit 7a0f20e5451cc2f50b66027cfaa826f3ba1219a4
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jun 10 22:09:09 2009 +0100
Don't hang when querying for the transfer properties
When we do a GetProperties on the transfer, obexd might be busy,
so don't hang onto that.
---
sendto/main.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/sendto/main.c b/sendto/main.c
index 901eccf..571856f 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -345,18 +345,18 @@ static gchar *get_device_name(const gchar *address)
return name;
}
-static gboolean request_callback(DBusGMethodInvocation *context,
- DBusGProxy *transfer, gpointer user_data)
+static void get_properties_callback (DBusGProxy *proxy,
+ DBusGProxyCall *call,
+ void *user_data)
{
+ GError *error = NULL;
gchar *filename = option_files[file_index];
gchar *basename, *text, *markup;
GHashTable *hash;
- if (dbus_g_proxy_call(transfer,
- "GetProperties", NULL, G_TYPE_INVALID,
- dbus_g_type_get_map("GHashTable",
- G_TYPE_STRING, G_TYPE_VALUE),
- &hash, G_TYPE_INVALID) == TRUE) {
+ if (dbus_g_proxy_end_call (proxy, call, &error,
+ dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &hash,
+ G_TYPE_INVALID) != FALSE) {
GValue *value;
value = g_hash_table_lookup(hash, "Size");
@@ -385,6 +385,14 @@ static gboolean request_callback(DBusGMethodInvocation *context,
file_index + 1, file_count);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), text);
g_free(text);
+}
+
+static gboolean request_callback(DBusGMethodInvocation *context,
+ DBusGProxy *transfer, gpointer user_data)
+{
+ dbus_g_proxy_begin_call(transfer, "GetProperties",
+ get_properties_callback, NULL, NULL,
+ G_TYPE_INVALID);
dbus_g_method_return(context, "");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]