[PATCH] Make bluetooth-sendto functional with ODS SVN head

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

 



Hi:

In trying to verify that all functionality is working in the 4.x stack, I found bluetooth-sendto to be fairly broken.  You can't use it with a release version of ODS because the release version only supports 3.x.  The SVN head version changed APIs though for the 4.x stuff, and expects different behavior.

The attached patch makes it work with SVN head of ODS.  This should be used in conjunction with Bastien's patch.

Regards

Mario Limonciello 
Dell | Linux Engineering 
Mario_Limonciello@xxxxxxxx 


diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.5/common/marshal.list bluez-gnome-1.5.new/common/marshal.list
--- bluez-gnome-1.5/common/marshal.list	2008-08-24 16:14:24.000000000 -0500
+++ bluez-gnome-1.5.new/common/marshal.list	2008-09-27 20:17:37.000000000 -0500
@@ -3,3 +3,4 @@
 VOID:STRING,STRING
 VOID:STRING,STRING,UINT64
 VOID:UINT64
+VOID:STRING,STRING,STRING
diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.5/sendto/main.c bluez-gnome-1.5.new/sendto/main.c
--- bluez-gnome-1.5/sendto/main.c	2008-09-27 20:17:30.000000000 -0500
+++ bluez-gnome-1.5.new/sendto/main.c	2008-09-27 20:17:35.000000000 -0500
@@ -60,6 +60,8 @@
 static gint64 first_update = 0;
 static gint64 last_update = 0;
 
+static DBusGProxy *session_proxy = NULL;
+
 static gchar *filename_to_path(const gchar *filename)
 {
 	GFile *file;
@@ -350,7 +352,16 @@
 static void error_occurred(DBusGProxy *proxy, const gchar *name,
 				const gchar *message, gpointer user_data)
 {
-	transfer_completed(proxy, user_data);
+	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress),
+							_("Error Occurred"));
+							
+	gchar *text = g_strdup_printf("<span foreground=\"red\">%s</span>",
+								message);
+	gtk_label_set_markup(GTK_LABEL(label_status), text);
+	g_free(text);
+
+	gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
+						GTK_RESPONSE_CLOSE, TRUE);
 }
 
 static void session_connected(DBusGProxy *proxy, gpointer user_data)
@@ -359,7 +370,7 @@
 
 	first_update = get_system_time();
 
-	send_file(proxy);
+	send_file(session_proxy);
 }
 
 #define OPENOBEX_CONNECTION_FAILED "org.openobex.Error.ConnectionAttemptFailed"
@@ -403,60 +414,41 @@
 	if (dbus_g_proxy_end_call(proxy, call, &error,
 					DBUS_TYPE_G_OBJECT_PATH, &path,
 						G_TYPE_INVALID) == FALSE) {
-		gchar *text, *message;
+		gchar *message;
 
 		message = get_error_message(error);
 
-		text = g_strdup_printf("<span foreground=\"red\">%s</span>",
-								message);
-		gtk_label_set_markup(GTK_LABEL(label_status), text);
-		g_free(text);
+		error_occurred(proxy,NULL,message,NULL);
 
 		g_free(message);
 
-		gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
-						GTK_RESPONSE_CLOSE, TRUE);
 		return;
 	}
-
-	proxy = dbus_g_proxy_new_for_name(conn, "org.openobex",
+	session_proxy = dbus_g_proxy_new_for_name(conn, "org.openobex",
 						path, "org.openobex.Session");
 
-	dbus_g_proxy_add_signal(proxy, "Connected", G_TYPE_INVALID);
-
-	dbus_g_proxy_connect_signal(proxy, "Connected",
-				G_CALLBACK(session_connected), NULL, NULL);
+	dbus_g_proxy_add_signal(session_proxy, "Cancelled", G_TYPE_INVALID);
 
-	dbus_g_proxy_add_signal(proxy, "ErrorOccurred",
-				G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
-
-	dbus_g_proxy_connect_signal(proxy, "ErrorOccurred",
-				G_CALLBACK(error_occurred), NULL, NULL);
-
-	dbus_g_proxy_add_signal(proxy, "Cancelled", G_TYPE_INVALID);
-
-	dbus_g_proxy_connect_signal(proxy, "Cancelled",
+	dbus_g_proxy_connect_signal(session_proxy, "Cancelled",
 				G_CALLBACK(transfer_cancelled), NULL, NULL);
 
-	dbus_g_proxy_add_signal(proxy, "TransferStarted", G_TYPE_STRING,
+	dbus_g_proxy_add_signal(session_proxy, "TransferStarted", G_TYPE_STRING,
 				G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_INVALID);
 
-	dbus_g_proxy_connect_signal(proxy, "TransferStarted",
+	dbus_g_proxy_connect_signal(session_proxy, "TransferStarted",
 				G_CALLBACK(transfer_started), NULL, NULL);
 
-	dbus_g_proxy_add_signal(proxy, "TransferProgress",
+	dbus_g_proxy_add_signal(session_proxy, "TransferProgress",
 						G_TYPE_UINT64, G_TYPE_INVALID);
 
-	dbus_g_proxy_connect_signal(proxy, "TransferProgress",
+	dbus_g_proxy_connect_signal(session_proxy, "TransferProgress",
 				G_CALLBACK(transfer_progress), NULL, NULL);
 
-	dbus_g_proxy_add_signal(proxy, "TransferCompleted", G_TYPE_INVALID);
+	dbus_g_proxy_add_signal(session_proxy, "TransferCompleted", G_TYPE_INVALID);
 
-	dbus_g_proxy_connect_signal(proxy, "TransferCompleted",
+	dbus_g_proxy_connect_signal(session_proxy, "TransferCompleted",
 				G_CALLBACK(transfer_completed), NULL, NULL);
 
-	dbus_g_proxy_call(proxy, "Connect", NULL, G_TYPE_INVALID,
-							G_TYPE_INVALID);
 }
 
 static gchar *get_name(DBusGProxy *device)
@@ -645,6 +637,14 @@
 
 	dbus_g_object_register_marshaller(marshal_VOID__UINT64,
 				G_TYPE_NONE, G_TYPE_UINT64, G_TYPE_INVALID);
+				
+	dbus_g_object_register_marshaller(marshal_VOID__STRING_STRING_STRING,
+                                       G_TYPE_NONE,
+                                       DBUS_TYPE_G_OBJECT_PATH,
+                                       G_TYPE_STRING,
+                                       G_TYPE_STRING,
+                                       G_TYPE_INVALID);
+
 
 	device_name = get_device_name(option_device);
 	if (device_name == NULL)
@@ -661,6 +661,18 @@
 	dbus_g_proxy_connect_signal(proxy, "NameOwnerChanged",
 				G_CALLBACK(name_owner_changed), NULL, NULL);
 
+	dbus_g_proxy_add_signal(proxy, "SessionConnected", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
+
+	dbus_g_proxy_connect_signal(proxy, "SessionConnected",
+				G_CALLBACK(session_connected), NULL, NULL);
+
+	dbus_g_proxy_add_signal(proxy, "SessionConnectError",
+				DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
+
+	dbus_g_proxy_connect_signal(proxy, "SessionConnectError",
+				G_CALLBACK(error_occurred), NULL, NULL);
+
+
 	dbus_g_proxy_begin_call(proxy, "CreateBluetoothSession",
 				create_notify, NULL, NULL,
 				G_TYPE_STRING, option_device,

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux