rpms/gnome-bluetooth/F-12 0001-Remove-hard-coded-use-of-nautilus.patch, NONE, 1.1 gnome-bluetooth.spec, 1.100, 1.101

Bastien Nocera hadess at fedoraproject.org
Thu Jan 7 17:56:54 UTC 2010


Author: hadess

Update of /cvs/pkgs/rpms/gnome-bluetooth/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16869

Modified Files:
	gnome-bluetooth.spec 
Added Files:
	0001-Remove-hard-coded-use-of-nautilus.patch 
Log Message:
* Thu Jan 07 2010 Bastien Nocera <bnocera at redhat.com> 2.28.6-2
- Remove hard-coded use of nautilus (#553083)


0001-Remove-hard-coded-use-of-nautilus.patch:
 main.c |   42 +++++++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 11 deletions(-)

--- NEW FILE 0001-Remove-hard-coded-use-of-nautilus.patch ---
>From 308e1c6f32168c031a59a90b400aba1033c0de15 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess at hadess.net>
Date: Thu, 7 Jan 2010 17:49:23 +0000
Subject: [PATCH] Remove hard-coded use of nautilus

And hope the user has a file manager installed anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=553083
---
 applet/main.c |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/applet/main.c b/applet/main.c
index 9bee2b0..cb17ebe 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -100,9 +100,33 @@ select_device_changed(BluetoothChooser *sel,
 				GTK_RESPONSE_ACCEPT, address != NULL);
 }
 
+static void
+mount_finish_cb (GObject *source_object,
+		 GAsyncResult *res,
+		 gpointer user_data)
+{
+	GError *error = NULL;
+	char *uri;
+
+	if (g_file_mount_enclosing_volume_finish (G_FILE (source_object),
+						  res, &error) == FALSE) {
+		g_printerr ("Failed to mount OBEX volume: %s", error->message);
+		g_error_free (error);
+		return;
+	}
+
+	uri = g_file_get_uri (G_FILE (source_object));
+	if (gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, &error) == FALSE) {
+		g_printerr ("Failed to open %s: %s", uri, error->message);
+		g_error_free (error);
+	}
+	g_free (uri);
+}
+
 void browse_callback(GObject *widget, gpointer user_data)
 {
-	char *address, *cmd;
+	GFile *file;
+	char *address, *uri;
 
 	address = g_strdup (g_object_get_data (widget, "address"));
 	if (address == NULL) {
@@ -146,14 +170,14 @@ void browse_callback(GObject *widget, gpointer user_data)
 			return;
 	}
 
-	cmd = g_strdup_printf("%s --no-default-window \"obex://[%s]\"",
-			      "nautilus", address);
+	uri = g_strdup_printf ("obex://[%s]/", address);
 	g_free (address);
 
-	if (!g_spawn_command_line_async(cmd, NULL))
-		g_printerr("Couldn't execute command: %s\n", cmd);
+	file = g_file_new_for_uri (uri);
+	g_free (uri);
 
-	g_free (cmd);
+	g_file_mount_enclosing_volume (file, G_MOUNT_MOUNT_NONE, NULL, NULL, mount_finish_cb, NULL);
+	g_object_unref (file);
 }
 
 void sendto_callback(GObject *widget, gpointer user_data)
@@ -380,10 +404,7 @@ update_menu_items (void)
 	if (enabled == FALSE)
 		return;
 
-	object = gtk_builder_get_object (xml, "browse-device");
-	gtk_action_set_sensitive (GTK_ACTION (object),
-				  program_available ("nautilus"));
-
+	gtk_action_set_sensitive (GTK_ACTION (object), TRUE);
 }
 
 static void
-- 
1.6.6



Index: gnome-bluetooth.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-bluetooth/F-12/gnome-bluetooth.spec,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -p -r1.100 -r1.101
--- gnome-bluetooth.spec	22 Dec 2009 14:05:59 -0000	1.100
+++ gnome-bluetooth.spec	7 Jan 2010 17:56:53 -0000	1.101
@@ -1,6 +1,6 @@
 Name:		gnome-bluetooth
 Version:	2.28.6
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	Bluetooth graphical utilities
 
 Group:		Applications/Communications
@@ -34,6 +34,9 @@ Requires:	pulseaudio-module-bluetooth
 Requires(post):		desktop-file-utils
 Requires(postun):	desktop-file-utils
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=553083
+Patch0:		0001-Remove-hard-coded-use-of-nautilus.patch
+
 %description
 The gnome-bluetooth package contains graphical utilities to setup,
 monitor and use Bluetooth devices.
@@ -62,6 +65,7 @@ for writing applications that require a 
 
 %prep
 %setup -q -n gnome-bluetooth-%{version}
+%patch0 -p1 -b .nautilus
 
 %build
 %configure --disable-desktop-update --disable-icon-update
@@ -194,6 +198,9 @@ fi
 %{_datadir}/gtk-doc/html/gnome-bluetooth/
 
 %changelog
+* Thu Jan 07 2010 Bastien Nocera <bnocera at redhat.com> 2.28.6-2
+- Remove hard-coded use of nautilus (#553083)
+
 * Tue Dec 22 2009 Bastien Nocera <bnocera at redhat.com> 2.28.6-1
 - Update to 2.28.6
 




More information about the fedora-extras-commits mailing list