rpms/rhythmbox/devel rb-gvfs-cdda-activation.patch, NONE, 1.1 rhythmbox.spec, 1.181, 1.182

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Fri Apr 4 12:29:31 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24360

Modified Files:
	rhythmbox.spec 
Added Files:
	rb-gvfs-cdda-activation.patch 
Log Message:
* Fri Apr 04 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.5-6
- Add patch to fix CDDA autostart from nautilus (#440489)


rb-gvfs-cdda-activation.patch:

--- NEW FILE rb-gvfs-cdda-activation.patch ---
Index: shell/rb-shell.c
===================================================================
--- shell/rb-shell.c	(revision 5666)
+++ shell/rb-shell.c	(working copy)
@@ -3327,13 +3327,21 @@
 								     uri, error))
 					return FALSE;
 			}
-		} else if (result == TOTEM_PL_PARSER_RESULT_IGNORED && rb_uri_is_local (uri)) {
-			/* That happens for directories */
+		} else if ((result == TOTEM_PL_PARSER_RESULT_IGNORED && rb_uri_is_local (uri))
+			   || result == TOTEM_PL_PARSER_RESULT_UNHANDLED) {
+			/* That happens for directories and unhandled schemes, such as CDDA */
 			playlist_source = rb_shell_guess_source_for_uri (shell, uri);
 			if (playlist_source == NULL || rb_source_uri_is_source (playlist_source, uri) == FALSE) {
-				rb_debug ("%s is a directory, but doesn't have a source, adding as a dir", uri);
-				if (!rb_shell_add_uri (shell, uri, NULL, NULL, error))
+				/* Do we have a directory? */
+				if (rb_uri_is_local (uri)) {
+					rb_debug ("%s is a directory, but doesn't have a source, adding as a dir", uri);
+					if (!rb_shell_add_uri (shell, uri, NULL, NULL, error))
+						return FALSE;
+				} else {
+					/* Or something else? */
+					rb_debug ("%s is not handled as a playlist, isn't local, and doesn't have a source, doing nothing", uri);
 					return FALSE;
+				}
 			}
 		} else {
 			rb_debug ("%s didn't parse as a playlist", uri);
@@ -3350,7 +3358,14 @@
 
 	if (play) {
 		if (playlist_source != NULL) {
+			char *name;
+
 			rb_shell_activate_source (shell, playlist_source);
+
+			g_object_get (playlist_source, "name", &name, NULL);
+			rb_debug ("Activated source '%s' for uri %s", name, uri);
+			g_free (name);
+
 			return TRUE;
 		}
 
Index: data/rhythmbox.desktop.in.in
===================================================================
--- data/rhythmbox.desktop.in.in	(revision 5666)
+++ data/rhythmbox.desktop.in.in	(working copy)
@@ -2,7 +2,7 @@
 _Name=Rhythmbox Music Player
 _GenericName=Music Player
 _Comment=Play and organize your music collection
-Exec=rhythmbox
+Exec=rhythmbox %U
 Terminal=false
 Type=Application
 Icon=rhythmbox
Index: plugins/audiocd/rb-audiocd-source.c
===================================================================
--- plugins/audiocd/rb-audiocd-source.c	(revision 5666)
+++ plugins/audiocd/rb-audiocd-source.c	(working copy)
@@ -768,6 +768,28 @@
 	return actions;
 }
 
+static char *
+_gnome_vfs_to_gvfs_cdda_uri (const char *gnome_vfs_uri)
+{
+	GString *retval;
+	guint i;
+
+	if (strstr (gnome_vfs_uri, "/dev/") == NULL)
+		return NULL;
+
+	retval = g_string_new ("");
+	for (i = 0; gnome_vfs_uri[i] != '\0' ;) {
+		if (strncmp (gnome_vfs_uri + i, "/dev/", 5) == 0)
+			i += 5;
+		else {
+			g_string_append_c (retval, gnome_vfs_uri[i]);
+			i++;
+		}
+	}
+
+	return g_string_free (retval, FALSE);
+}
+
 static guint
 impl_want_uri (RBSource *source, const char *uri)
 {
@@ -792,7 +814,17 @@
 
 	if (strcmp (activation_uri, uri) == 0)
 		retval = 100;
+	else {
+		char *gvfs_uri;
 
+		/* FIXME work-around "new" gvfs style URLs:
+		 * cdda://sr0/ instead of cdda:///dev/sr0 */
+		gvfs_uri = _gnome_vfs_to_gvfs_cdda_uri (activation_uri);
+		if (strncmp (gvfs_uri, uri, strlen (gvfs_uri - 1)) == 0)
+			retval = 100;
+		g_free (gvfs_uri);
+	}
+
 	g_free (activation_uri);
 
 	return retval;


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/rhythmbox.spec,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -r1.181 -r1.182
--- rhythmbox.spec	31 Mar 2008 12:50:27 -0000	1.181
+++ rhythmbox.spec	4 Apr 2008 12:28:46 -0000	1.182
@@ -3,7 +3,7 @@
 Name: rhythmbox
 Summary: Music Management Application 
 Version: 0.11.5
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2+ and GFDL+
 Group: Applications/Multimedia
 URL: http://www.gnome.org/projects/rhythmbox/
@@ -60,6 +60,9 @@
 Patch3: rb-soup_encode_uri-changes.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=524967
 Patch4: rhythmbox-0.11.5-force-podcast-parsing.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=526139
+# https://bugzilla.redhat.com/show_bug.cgi?id=440489
+Patch5: rb-gvfs-cdda-activation.patch
 
 %description
 Rhythmbox is an integrated music management application based on the powerful
@@ -93,6 +96,7 @@
 %patch2 -p0 -b .source-unref-crasher
 %patch3 -p1 -b .soup-2.4
 %patch4 -p0 -b .force-podcast
+%patch5 -p0 -b .cdda-activation
 
 %build
 # work around a gstreamer bug
@@ -206,6 +210,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Fri Apr 04 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.5-6
+- Add patch to fix CDDA autostart from nautilus (#440489)
+
 * Mon Mar 31 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.5-5
 - Force podcast parsing, as we already know it's a Podcast
 




More information about the fedora-extras-commits mailing list