[arch-commits] CVS update of extra/gnome/nautilus (6 files)

Jan de Groot jgc at archlinux.org
Tue Dec 11 19:38:57 UTC 2007


    Date: Tuesday, December 11, 2007 @ 14:38:57
  Author: jgc
    Path: /home/cvs-extra/extra/gnome/nautilus

   Added: nautilus-2.20.0-async-thumbnail-framing.patch (1.1)
          nautilus-2.20.0-small-font-crasher.patch (1.1)
          nautilus-2.20.0-sound-preview-cleanup.patch (1.1)
          nautilus-2.20.0-thumbnail-flashing.patch (1.1)
Modified: PKGBUILD (1.42 -> 1.43)
 Removed: 12_list-view_expand.patch (1.1)

upgpkg: nautilus 2.20.0-4
Run autofoo after applying beagle patch (FS#8871)
Depend on desktop-file-utils (FS#8432)
Fix some crashes (hopefully fixes FS#8228)
Fix thumbnail borders (FS#8833)
Use totem or GStreamer to preview audio instead of Esound


-----------------------------------------------+
 12_list-view_expand.patch                     |   32 -
 PKGBUILD                                      |   37 +-
 nautilus-2.20.0-async-thumbnail-framing.patch |   27 +
 nautilus-2.20.0-small-font-crasher.patch      |   12 
 nautilus-2.20.0-sound-preview-cleanup.patch   |  414 ++++++++++++++++++++++++
 nautilus-2.20.0-thumbnail-flashing.patch      |  145 ++++++++
 6 files changed, 623 insertions(+), 44 deletions(-)


Index: extra/gnome/nautilus/12_list-view_expand.patch
diff -u extra/gnome/nautilus/12_list-view_expand.patch:1.1 extra/gnome/nautilus/12_list-view_expand.patch:removed
--- extra/gnome/nautilus/12_list-view_expand.patch:1.1	Thu May 31 07:47:16 2007
+++ extra/gnome/nautilus/12_list-view_expand.patch	Tue Dec 11 14:38:57 2007
@@ -1,32 +0,0 @@
-Index: nautilus-2.18.1/src/file-manager/fm-list-view.c
-===================================================================
---- nautilus-2.18.1.orig/src/file-manager/fm-list-view.c	2007-04-10 14:05:29.000000000 +0200
-+++ nautilus-2.18.1/src/file-manager/fm-list-view.c	2007-05-16 00:46:09.805874250 +0200
-@@ -1337,7 +1337,7 @@
- 
- 	for (l = nautilus_columns; l != NULL; l = l->next) {
- 		NautilusColumn *nautilus_column;
--		int column_num;		
-+		int column_num, font_size;
- 		char *name;
- 		char *label;
- 		float xalign;
-@@ -1360,6 +1360,9 @@
- 			view->details->pixbuf_cell = (GtkCellRendererPixbuf *)cell;
- 			
- 			view->details->file_name_column = gtk_tree_view_column_new ();
-+			gtk_tree_view_column_set_expand (view->details->file_name_column, TRUE);
-+			font_size = PANGO_PIXELS (pango_font_description_get_size (GTK_WIDGET(view)->style->font_desc));
-+			gtk_tree_view_column_set_min_width (view->details->file_name_column, 16*font_size);
- 			g_object_ref (view->details->file_name_column);
- 			gtk_object_sink (GTK_OBJECT (view->details->file_name_column));
- 			view->details->file_name_column_num = column_num;
-@@ -1384,7 +1387,7 @@
- 			cell = gtk_cell_renderer_text_new ();
-                         g_object_set (cell,
-                                       "ellipsize", PANGO_ELLIPSIZE_END,
--                                      "width-chars", 32,
-+                                      "ellipsize-set", TRUE,
-                                       NULL);
- 			view->details->file_name_cell = (GtkCellRendererText *)cell;
- 			g_signal_connect (cell, "edited", G_CALLBACK (cell_renderer_edited), view);
Index: extra/gnome/nautilus/PKGBUILD
diff -u extra/gnome/nautilus/PKGBUILD:1.42 extra/gnome/nautilus/PKGBUILD:1.43
--- extra/gnome/nautilus/PKGBUILD:1.42	Mon Dec  3 06:01:14 2007
+++ extra/gnome/nautilus/PKGBUILD	Tue Dec 11 14:38:56 2007
@@ -1,32 +1,45 @@
-# $Id: PKGBUILD,v 1.42 2007/12/03 11:01:14 varun Exp $
+# $Id: PKGBUILD,v 1.43 2007/12/11 19:38:56 jgc Exp $
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 
 pkgname=nautilus
 pkgver=2.20.0
-pkgrel=3
+pkgrel=4
 pkgdesc="The GNOME shell and file manager"
 arch=(i686 x86_64)
 license=('GPL')
-depends=('librsvg>=2.18.2' 'eel>=2.20.0' 'libbeagle>=0.3.0-2' 'libexif>=0.6.16' 'gnome-icon-theme>=2.20.0')
-makedepends=('perlxml' 'pkgconfig')
+depends=('librsvg>=2.18.2' 'eel>=2.20.0' 'libbeagle>=0.3.0-2' 'libexif>=0.6.16' 'gnome-icon-theme>=2.20.0' 'desktop-file-utils')
+makedepends=('intltool' 'pkgconfig')
 url="http://www.gnome.org"
 groups=('gnome')
 replaces=('fontilus')
 options=('!libtool' '!emptydirs')
 install=nautilus.install
-source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.20/${pkgname}-${pkgver}.tar.bz2 \
-        beagle-0.3.0.patch)
-md5sums=('3856ec2ffeba786d12f8f6622e398c33' \
-         'dff10b37d6636f6338df6379edc535e6')
-
-         
+source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.20/${pkgname}-${pkgver}.tar.bz2
+        beagle-0.3.0.patch
+	nautilus-2.20.0-async-thumbnail-framing.patch
+	nautilus-2.20.0-small-font-crasher.patch
+	nautilus-2.20.0-sound-preview-cleanup.patch
+	nautilus-2.20.0-thumbnail-flashing.patch)
+md5sums=('3856ec2ffeba786d12f8f6622e398c33'
+         'dff10b37d6636f6338df6379edc535e6'
+         '58dbb68fe0f549f778af2b5489064e64'
+         '50160d2e6221fc691f39f341467783e9'
+         'bc9e85eeace20684d29f698e145548ca'
+         '340aac6831eb26d04474c389c3150e42')
 
 build() {
   cd ${startdir}/src/${pkgname}-${pkgver}
-  patch -Np1 -i ${startdir}/beagle-0.3.0.patch
+  patch -Np1 -i ${startdir}/beagle-0.3.0.patch || return 1
+  patch -Np0 -i ${startdir}/src/nautilus-2.20.0-async-thumbnail-framing.patch || return 1
+  patch -Np0 -i ${startdir}/src/nautilus-2.20.0-small-font-crasher.patch || return 1
+  patch -Np1 -i ${startdir}/src/nautilus-2.20.0-sound-preview-cleanup.patch || return 1
+  patch -Np0 -i ${startdir}/src/nautilus-2.20.0-thumbnail-flashing.patch || return 1
+  aclocal || return 1
+  autoconf || return 1
+  automake || return 1
   ./configure --prefix=/usr --sysconfdir=/etc \
               --localstatedir=/var --disable-static \
-	      --disable-update-mimedb
+	      --disable-update-mimedb --disable-esound
   make || return 1
   make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${startdir}/pkg install || return 1
   
Index: extra/gnome/nautilus/nautilus-2.20.0-async-thumbnail-framing.patch
diff -u /dev/null extra/gnome/nautilus/nautilus-2.20.0-async-thumbnail-framing.patch:1.1
--- /dev/null	Tue Dec 11 14:38:57 2007
+++ extra/gnome/nautilus/nautilus-2.20.0-async-thumbnail-framing.patch	Tue Dec 11 14:38:56 2007
@@ -0,0 +1,27 @@
+* libnautilus-private/nautilus-icon-factory.c:
+	(async_thumbnail_load_func): Frame asynchronously loaded thumbnails.
+	Fixes #478363
+--- libnautilus-private/nautilus-icon-factory.c	2007/09/27 17:15:05	13235
++++ libnautilus-private/nautilus-icon-factory.c	2007/09/27 17:19:21	13236
+@@ -384,9 +384,21 @@
+ 		goto out;
+ 	}
+ 
++	if (!gdk_pixbuf_get_has_alpha (pixbuf)) {
++		/* we don't own the pixbuf, but nautilus_thumbnail_frame_image() assumes so and unrefs it. */
++		g_object_ref (pixbuf);
++
++		nautilus_thumbnail_frame_image (&pixbuf);
++		/* at this point, we own a pixbuf, which is the framed version of the passed-in pixbuf. */
++	}
++
+ 	cached_icon = cache_icon_new (pixbuf, NULL, scale_x, scale_y);
+ 	cached_icon->mtime = statbuf.st_mtime;
+ 
++	if (!gdk_pixbuf_get_has_alpha (pixbuf)) {
++		g_object_unref (pixbuf);
++	}
++
+ 	if (cached_icon != NULL) {
+ 		key = g_new (CacheKey, 1);
+ 		key->name = g_strdup (path);
Index: extra/gnome/nautilus/nautilus-2.20.0-small-font-crasher.patch
diff -u /dev/null extra/gnome/nautilus/nautilus-2.20.0-small-font-crasher.patch:1.1
--- /dev/null	Tue Dec 11 14:38:57 2007
+++ extra/gnome/nautilus/nautilus-2.20.0-small-font-crasher.patch	Tue Dec 11 14:38:56 2007
@@ -0,0 +1,12 @@
+Fix crash with small fonts (#454884)
+--- src/nautilus-sidebar-title.c	2007/10/03 06:38:48	13255
++++ src/nautilus-sidebar-title.c	2007/10/03 06:39:37	13256
+@@ -364,7 +364,7 @@
+ 	title_font = pango_font_description_copy (style->font_desc);
+ 
+ 	max_style_font_size = pango_font_description_get_size (title_font) * 1.8 / PANGO_SCALE;
+-	if (max_style_font_size < MIN_TITLE_FONT_SIZE) {
++	if (max_style_font_size < MIN_TITLE_FONT_SIZE + 1) {
+ 		max_style_font_size = MIN_TITLE_FONT_SIZE + 1;
+ 	}
+ 
Index: extra/gnome/nautilus/nautilus-2.20.0-sound-preview-cleanup.patch
diff -u /dev/null extra/gnome/nautilus/nautilus-2.20.0-sound-preview-cleanup.patch:1.1
--- /dev/null	Tue Dec 11 14:38:57 2007
+++ extra/gnome/nautilus/nautilus-2.20.0-sound-preview-cleanup.patch	Tue Dec 11 14:38:56 2007
@@ -0,0 +1,414 @@
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN nautilus-2.20.0.orig/configure.in nautilus-2.20.0/configure.in
+--- nautilus-2.20.0.orig/configure.in	2007-09-18 02:55:14.000000000 -0400
++++ nautilus-2.20.0/configure.in	2007-10-29 10:50:48.000000000 -0400
+@@ -90,7 +90,6 @@ fi
+ AC_SUBST(STARTUP_NOTIFICATION_PACKAGE)
+ 
+ PKG_CHECK_MODULES(ALL, [
+-	esound			>= esound_minver
+ 	bonobo-activation-2.0	>= bonobo_activation_minver
+ 	eel-2.0			>= eel_minver
+ 	glib-2.0		>= glib_minver
+@@ -312,6 +311,25 @@ fi
+ 
+ dnl ==========================================================================
+ 
++AM_CONDITIONAL(HAVE_ESOUND, false)
++
++dnl esound checking
++			    			  
++AC_ARG_ENABLE(esound, [  --disable-esound     build without esound support])
++msg_esound=no
++if test "x$enable_esound" != "xno"; then
++	PKG_CHECK_MODULES(ESOUND, esound >= esound_minver, [
++		  	  AM_CONDITIONAL(HAVE_ESOUND, true)
++			  AC_DEFINE(HAVE_ESOUND, 1, [Define to enable esound support])
++			  ]
++                          msg_esound=yes,
++	          	  [AM_CONDITIONAL(HAVE_ESOUND, false)])
++        AC_SUBST(ESOUND_CFLAGS)
++	AC_SUBST(ESOUND_LIBS)
++fi
++
++dnl ==========================================================================
++
+ dnl ****************************
+ dnl *** Check for libselinux ***
+ dnl ****************************
+@@ -404,7 +422,7 @@ LIBNAUTILUS_EXTENSION_LIBS="`$PKG_CONFIG
+ AC_SUBST(LIBNAUTILUS_EXTENSION_LIBS)
+ 
+ dnl core nautilus (must list bonobo-activation and libbonobo because idldir does not respect "requires")
+-CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 esound gnome-desktop-2.0 gnome-vfs-module-2.0 $EXTRA_CORE_MODULES"
++CORE_MODULES="eel-2.0 librsvg-2.0 bonobo-activation-2.0 libbonobo-2.0 gnome-desktop-2.0 gnome-vfs-module-2.0 $EXTRA_CORE_MODULES"
+ CORE_CFLAGS="`$PKG_CONFIG --cflags $CORE_MODULES` $x_cflags $WARNING_CFLAGS"
+ AC_SUBST(CORE_CFLAGS)
+ CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $x_libs"
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN nautilus-2.20.0.orig/libnautilus-private/Makefile.am nautilus-2.20.0/libnautilus-private/Makefile.am
+--- nautilus-2.20.0.orig/libnautilus-private/Makefile.am	2007-08-21 05:37:54.000000000 -0400
++++ nautilus-2.20.0/libnautilus-private/Makefile.am	2007-10-29 10:50:48.000000000 -0400
+@@ -10,6 +10,7 @@ INCLUDES = 						\
+ 	$(DISABLE_DEPRECATED_CFLAGS)			\
+ 	$(TRACKER_CFLAGS)				\
+ 	$(BEAGLE_CFLAGS)				\
++	$(ESOUND_CFLAGS)				\
+ 	-DDATADIR=\""$(datadir)"\" 			\
+ 	-DSYSCONFDIR=\""$(sysconfdir)"\" 			\
+ 	-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" 	\
+@@ -31,6 +32,7 @@ libnautilus_private_la_LIBADD =		\
+ 	$(SELINUX_LIBS)			\
+ 	$(BEAGLE_LIBS)			\
+ 	$(TRACKER_LIBS)			\
++	$(ESOUND_LIBS)			\
+ 	$(top_builddir)/libnautilus-extension/libnautilus-extension.la \
+ 	$(CORE_LIBS)			\
+ 	$(NULL)
+@@ -49,8 +51,6 @@ marshal_sources = \
+ 
+ libnautilus_private_la_SOURCES = \
+ 	$(nautilus_metafile_server_idl_sources)	\
+-	nautilus-audio-player.c \
+-	nautilus-audio-player.h \
+ 	nautilus-bookmark.c \
+ 	nautilus-bookmark.h \
+ 	nautilus-cell-renderer-pixbuf-emblem.c \
+@@ -228,6 +228,14 @@ if HAVE_TRACKER
+ libnautilus_private_la_SOURCES += $(TRACKER_SOURCES)
+ endif
+ 
++ESOUND_SOURCES = \
++	nautilus-audio-player.c \
++	nautilus-audio-player.h
++
++if HAVE_ESOUND
++libnautilus_private_la_SOURCES += $(ESOUND_SOURCES)
++endif
++
+ $(lib_LTLIBRARIES): $(dependency_static_libs)
+ 
+ $(nautilus_metafile_server_idl_sources): nautilus_metafile_server_idl_stamp
+@@ -264,6 +272,7 @@ EXTRA_DIST = 				\
+ 	nautilus-marshal.list		\
+ 	$(schema_in_files)              \
+ 	$(BEAGLE_SOURCES)		\
++	$(ESOUND_SOURCES)		\
+ 	$(TRACKER_SOURCES)		\
+ 	$(NULL)
+ 
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN nautilus-2.20.0.orig/src/file-manager/fm-icon-view.c nautilus-2.20.0/src/file-manager/fm-icon-view.c
+--- nautilus-2.20.0.orig/src/file-manager/fm-icon-view.c	2007-04-03 06:08:04.000000000 -0400
++++ nautilus-2.20.0/src/file-manager/fm-icon-view.c	2007-10-29 12:02:21.000000000 -0400
+@@ -24,6 +24,7 @@
+ 
+ #include <config.h>
+ #include "fm-icon-view.h"
++#include "nautilus-audio-mime-types.h"
+ 
+ #include "fm-actions.h"
+ #include "fm-icon-container.h"
+@@ -78,7 +79,9 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
++#ifdef HAVE_ESOUND
+ #include <esd.h>
++#endif
+ 
+ #define USE_OLD_AUDIO_PREVIEW 1
+ #define READ_CHUNK_SIZE 16384
+@@ -165,9 +168,8 @@ static const SortCriterion sort_criteria
+ 
+ static gboolean default_sort_in_reverse_order = FALSE;
+ static int preview_sound_auto_value;
+-static gboolean gnome_esd_enabled_auto_value;
+ 
+-#if USE_OLD_AUDIO_PREVIEW
++#ifndef HAVE_ESOUND
+ static pid_t audio_preview_pid = 0;
+ #endif
+ 
+@@ -1747,60 +1749,59 @@ band_select_ended_callback (NautilusIcon
+ 
+ /* handle the preview signal by inspecting the mime type.  For now, we only preview local sound files. */
+ 
++#ifndef HAVE_ESOUND
++static char *
++get_preview_command (void)
++{
++	char *command;
++
++	command = g_find_program_in_path ("totem-audio-preview");
++	if (command)
++		return command;
++	command = g_find_program_in_path ("gst-launch-0.10");
++	if (command) {
++		char *new_cmd;
++
++		new_cmd = g_strdup_printf ("%s playbin uri=fd://0", command);
++		g_free (command);
++		return new_cmd;
++	}
++
++	return NULL;
++}
++#endif /* !HAVE_ESOUND */
++
+ /* here's the timer task that actually plays the file using mpg123, ogg123 or play. */
+ /* FIXME bugzilla.gnome.org 41258: we should get the application from our mime-type stuff */
+ static gboolean
+ play_file (gpointer callback_data)
+ {
+-#if USE_OLD_AUDIO_PREVIEW	
++#ifndef HAVE_ESOUND
+ 	NautilusFile *file;
+ 	FMIconView *icon_view;
+ 	FILE *sound_process;
+ 	char *file_uri;
+-	char *suffix;
+-	char *mime_type;
+-	const char *command_str;
+-	gboolean is_mp3;
+-	gboolean is_ogg;
++	char *command_str;
+ 	pid_t mp3_pid;
+ 	
+ 	GnomeVFSResult result;
+ 	GnomeVFSHandle *handle;
+ 	char *buffer;
+-	const char *audio_device = NULL;
+ 	GnomeVFSFileSize bytes_read;
+ 
+-	audio_device = g_getenv ("AUDIODEV");
+ 	icon_view = FM_ICON_VIEW (callback_data);
++
++	command_str = get_preview_command ();
++	if (command_str == NULL)
++		return FALSE;
+ 	
+ 	file = icon_view->details->audio_preview_file;
+ 	file_uri = nautilus_file_get_uri (file);
+-	mime_type = nautilus_file_get_mime_type (file);
+-	is_mp3 = eel_strcasecmp (mime_type, "audio/mpeg") == 0;
+-	is_ogg = eel_strcasecmp (mime_type, "application/ogg") == 0 ||
+-                eel_strcasecmp (mime_type, "application/x-ogg") == 0;
+ 	
+ 	mp3_pid = fork ();
+ 	if (mp3_pid == (pid_t) 0) {
+ 		/* Set the group (session) id to this process for future killing. */
+ 		setsid();
+-		if (is_mp3) {
+-			command_str = "mpg123 -y -q -";
+-		} else if (is_ogg) {
+-			command_str = "ogg123 -q -";
+-		} else {
+-			suffix = strrchr(file_uri, '.');
+-			if (suffix == NULL) {
+-				suffix = "wav";
+-			} else {
+-				suffix += 1; /* skip the period */
+-			}
+-			if (audio_device) {
+-				command_str = g_strdup_printf("play -d %s -t %s -", audio_device, suffix);
+-			} else {
+-				command_str = g_strdup_printf("play -t %s -", suffix);
+-			}
+-		}
+ 
+ 		/* read the file with gnome-vfs, feeding it to the sound player's standard input */
+ 		/* First, open the file. */
+@@ -1851,10 +1852,10 @@ play_file (gpointer callback_data)
+ 	}
+ 		
+ 	g_free (file_uri);
+-	g_free (mime_type);
++	g_free (command_str);
+ 
+ 	icon_view->details->audio_preview_timeout = 0;
+-#else
++#else /* HAVE_ESOUND */
+ 	char *file_path, *file_uri, *mime_type;
+ 	gboolean is_mp3;
+ 	FMIconView *icon_view;
+@@ -1893,13 +1894,13 @@ static void
+ preview_audio (FMIconView *icon_view, NautilusFile *file, gboolean start_flag)
+ {		
+ 	/* Stop current audio playback */
+-#if USE_OLD_AUDIO_PREVIEW
++#ifndef HAVE_ESOUND
+ 	if (audio_preview_pid > 0) {
+ 		kill (-audio_preview_pid, SIGTERM);
+ 		waitpid (audio_preview_pid, NULL, 0);
+ 		audio_preview_pid = 0;
+ 	}
+-#else
++#else /* HAVE_ESOUND */
+ 	if (icon_view->details->audio_player_data != NULL) {
+ 		nautilus_audio_player_stop (icon_view->details->audio_player_data);
+ 		g_free (icon_view->details->audio_player_data);
+@@ -1913,9 +1914,9 @@ preview_audio (FMIconView *icon_view, Na
+ 			
+ 	if (start_flag) {
+ 		icon_view->details->audio_preview_file = file;
+-#if USE_OLD_AUDIO_PREVIEW			
++#ifndef HAVE_ESOUND
+ 		icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view);
+-#else
++#else /* HAVE_ESOUND */
+ 		/* FIXME: Need to kill the existing timeout if there is one? */
+ 		icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view);
+ #endif
+@@ -1923,15 +1924,31 @@ preview_audio (FMIconView *icon_view, Na
+ }
+ 
+ static gboolean
+-should_preview_sound (NautilusFile *file)
++sound_preview_type_supported (NautilusFile *file)
+ {
+-	char *uri;
++	char *mime_type;
++	guint i;
+ 
+-	/* Check gnome config sound preference */
+-	if (!gnome_esd_enabled_auto_value) {
++	mime_type = nautilus_file_get_mime_type (file);
++	if (mime_type == NULL)
+ 		return FALSE;
++	for (i = 0; i < G_N_ELEMENTS (audio_mime_types); i++) {
++		GnomeVFSMimeEquivalence equivalence = gnome_vfs_mime_type_get_equivalence (mime_type, audio_mime_types[i]);
++		if (equivalence == GNOME_VFS_MIME_IDENTICAL || equivalence == GNOME_VFS_MIME_PARENT) {
++			g_free (mime_type);
++			return TRUE;
++		}
+ 	}
+ 
++	g_free (mime_type);
++	return FALSE;
++}
++
++static gboolean
++should_preview_sound (NautilusFile *file)
++{
++	char *uri;
++
+ 	uri = nautilus_file_get_uri (file);
+ 	if (uri && eel_istr_has_prefix (uri, "burn:")) {
+ 		g_free (uri);
+@@ -1956,12 +1973,9 @@ can_play_sound (void)
+ {
+ 	int open_result;
+ 
+-#if USE_OLD_AUDIO_PREVIEW			
+-	/* first see if there's already one in progress; if so, return true */
+-	if (audio_preview_pid > 0) {
+-		return TRUE;
+-	}
+-#endif
++#ifndef HAVE_ESOUND
++	return TRUE;
++#else /* HAVE_ESOUND */
+ 
+ 	/* Now check and see if system has audio out capabilites */
+         open_result = esd_open_sound (NULL);
+@@ -1972,6 +1986,7 @@ can_play_sound (void)
+ 	esd_close (open_result);
+ 
+ 	return TRUE;
++#endif
+ }
+ 
+ static int
+@@ -1981,25 +1996,17 @@ icon_container_preview_callback (Nautilu
+ 				 FMIconView *icon_view)
+ {
+ 	int result;
+-	char *mime_type, *file_name, *message;
++	char *file_name, *message;
+ 		
+ 	result = 0;
+ 	
+ 	/* preview files based on the mime_type. */
+ 	/* at first, we just handle sounds */
+ 	if (should_preview_sound (file)) {
+-		mime_type = nautilus_file_get_mime_type (file);
+-
+-		if ((eel_istr_has_prefix (mime_type, "audio/")
+-		     || eel_istr_has_prefix (mime_type, "application/ogg")
+-		     || eel_istr_has_prefix (mime_type, "application/x-ogg"))
+-		    && eel_strcasecmp (mime_type, "audio/x-pn-realaudio") != 0
+-		    && eel_strcasecmp (mime_type, "audio/x-mpegurl") != 0
+-		    && can_play_sound ()) {
++		if (sound_preview_type_supported (file) && can_play_sound ()) {
+ 			result = 1;
+ 			preview_audio (icon_view, file, start_flag);
+ 		}	
+-		g_free (mime_type);
+ 	}
+ 	
+ 	/* Display file name in status area at low zoom levels, since
+@@ -2708,10 +2715,6 @@ fm_icon_view_init (FMIconView *icon_view
+ 		eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_PREVIEW_SOUND,
+ 					       &preview_sound_auto_value);
+ 
+-		eel_preferences_monitor_directory ("/desktop/gnome/sound");
+-		eel_preferences_add_auto_boolean ("/desktop/gnome/sound/enable_esd",
+-						  &gnome_esd_enabled_auto_value);
+-		
+ 		setup_sound_preview = TRUE;
+ 	}
+ 
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN nautilus-2.20.0.orig/src/file-manager/Makefile.am nautilus-2.20.0/src/file-manager/Makefile.am
+--- nautilus-2.20.0.orig/src/file-manager/Makefile.am	2007-06-27 03:12:32.000000000 -0400
++++ nautilus-2.20.0/src/file-manager/Makefile.am	2007-10-29 10:55:00.000000000 -0400
+@@ -38,6 +38,7 @@ libnautilus_file_manager_la_SOURCES=	\
+ 	fm-tree-model.h			\
+ 	fm-tree-view.c			\
+ 	fm-tree-view.h			\
++	nautilus-audio-mime-types.h	\
+ 	$(NULL)
+ 
+ EMPTY_VIEW_SOURCES = \
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN nautilus-2.20.0.orig/src/file-manager/nautilus-audio-mime-types.h nautilus-2.20.0/src/file-manager/nautilus-audio-mime-types.h
+--- nautilus-2.20.0.orig/src/file-manager/nautilus-audio-mime-types.h	1969-12-31 19:00:00.000000000 -0500
++++ nautilus-2.20.0/src/file-manager/nautilus-audio-mime-types.h	2007-10-29 10:55:00.000000000 -0400
+@@ -0,0 +1,41 @@
++/* generated with mime-types-include.sh in the totem module, don't edit or 
++   commit in the nautilus module without filing a bug against totem */
++static char *audio_mime_types[] = {
++"audio/3gpp",
++"audio/ac3",
++"audio/AMR",
++"audio/AMR-WB",
++"audio/basic",
++"audio/mp4",
++"audio/mpeg",
++"audio/mpegurl",
++"audio/ogg",
++"audio/vnd.rn-realaudio",
++"audio/x-ape",
++"audio/x-flac",
++"audio/x-it",
++"audio/x-m4a",
++"audio/x-matroska",
++"audio/x-mod",
++"audio/x-mp3",
++"audio/x-mpeg",
++"audio/x-mpegurl",
++"audio/x-ms-asf",
++"audio/x-ms-asx",
++"audio/x-ms-wax",
++"audio/x-ms-wma",
++"audio/x-musepack",
++"audio/x-pn-aiff",
++"audio/x-pn-au",
++"audio/x-pn-wav",
++"audio/x-pn-windows-acm",
++"audio/x-realaudio",
++"audio/x-real-audio",
++"audio/x-sbc",
++"audio/x-scpls",
++"audio/x-tta",
++"audio/x-wav",
++"audio/x-wav",
++"audio/x-wavpack",
++"audio/x-vorbis",
++};
Index: extra/gnome/nautilus/nautilus-2.20.0-thumbnail-flashing.patch
diff -u /dev/null extra/gnome/nautilus/nautilus-2.20.0-thumbnail-flashing.patch:1.1
--- /dev/null	Tue Dec 11 14:38:57 2007
+++ extra/gnome/nautilus/nautilus-2.20.0-thumbnail-flashing.patch	Tue Dec 11 14:38:56 2007
@@ -0,0 +1,145 @@
+2007-10-02  Frederic Crozat  <fcrozat at mandriva.com>
+
+	Backport from gio-branch, fixes #480608, from 
+	Alexander Larsson  <alexl at redhat.com>
+
+* libnautilus-private/nautilus-icon-factory.c:
+	Don't clear thumbnails and other absolute pathnames from icon
+	cache when mime data or icon theme changes. This is to avoid
+	flashing and async realoading of all thumbnails.
+
+* libnautilus-private/nautilus-directory-async.c:
+	(mime_db_changed_callback):
+	Use the right call to invalidate attributes, so that
+	they get re-read correctly.
+--- libnautilus-private/nautilus-icon-factory.c	2007/10/02 13:28:27	13248
++++ libnautilus-private/nautilus-icon-factory.c	2007/10/02 13:28:59	13249
+@@ -200,7 +200,7 @@
+ 							  const char               *modifier,
+ 							  guint                     nominal_size,
+ 							  gboolean		    force_nominal);
+-static void nautilus_icon_factory_clear                  (void);
++static void nautilus_icon_factory_clear                  (gboolean                  clear_pathnames);
+ 
+ GNOME_CLASS_BOILERPLATE (NautilusIconFactory,
+ 			 nautilus_icon_factory,
+@@ -270,7 +270,7 @@
+ {
+ 	NautilusIconFactory *factory;
+ 
+-	nautilus_icon_factory_clear ();
++	nautilus_icon_factory_clear (FALSE);
+ 
+ 	factory = user_data;
+ 
+@@ -726,9 +726,23 @@
+         return TRUE;
+ }
+ 
+-/* Reset the cache to the default state. */
++static gboolean
++remove_non_pathnames (gpointer _key, gpointer value, gpointer user_data)
++{
++	CacheKey *key = _key;
++	
++	if (key->name && key->name[0] == '/') {
++		return FALSE;
++	}
++	    
++        return TRUE; /* Tell the caller to remove the hash table entry. */
++}
++
++/* Reset the cache to the default state.
++   Clear pathnames can be set to FALSE which means we only clear icon names, not
++   absolute pathnames. This is useful to avoid throwing away all loaded thumbnails. */
+ static void
+-nautilus_icon_factory_clear (void)
++nautilus_icon_factory_clear (gboolean clear_pathnames)
+ {
+ 	NautilusIconFactory *factory;
+ 	CircularList *head;
+@@ -736,24 +750,25 @@
+ 	factory = get_icon_factory ();
+ 
+         g_hash_table_foreach_remove (factory->icon_cache,
+-				     remove_all,
++				     clear_pathnames ? remove_all : remove_non_pathnames,
+                                      NULL);
+ 	
+ 	/* Empty out the recently-used list. */
+ 	head = &factory->recently_used_dummy_head;
+ 
+-	/* fallback_icon hangs around, but we don't know if it
+-	 * was ever inserted in the list
+-	 */
+-	g_assert (factory->recently_used_count == 0 ||
+-		  factory->recently_used_count == 1);
+-
+-	if (factory->recently_used_count == 1) {
+-		/* make sure this one is the fallback_icon */
+-		g_assert (head->next == head->prev);
+-		g_assert (&factory->fallback_icon->recently_used_node == head->next);
++	if (clear_pathnames) {
++		/* fallback_icon hangs around, but we don't know if it
++		 * was ever inserted in the list
++		 */
++		g_assert (factory->recently_used_count == 0 ||
++			  factory->recently_used_count == 1);
++		if (factory->recently_used_count == 1) {
++			/* make sure this one is the fallback_icon */
++			g_assert (head->next == head->prev);
++			g_assert (&factory->fallback_icon->recently_used_node == head->next);
++		}
+ 	}
+-
++		
+ }
+ 
+ static void
+@@ -806,7 +821,7 @@
+ 	 * signal to mean only "thumbnails might have changed" if this ends up being slow
+ 	 * for some reason.
+ 	 */
+-	nautilus_icon_factory_clear ();
++	nautilus_icon_factory_clear (TRUE);
+ 	g_signal_emit (global_icon_factory,
+ 			 signals[ICONS_CHANGED], 0);
+ }
+@@ -820,7 +835,7 @@
+ 	 * signal to mean only "thumbnails might have changed" if this ends up being slow
+ 	 * for some reason.
+ 	 */
+-	nautilus_icon_factory_clear ();
++	nautilus_icon_factory_clear (TRUE);
+ 	g_signal_emit (global_icon_factory,
+ 			 signals[ICONS_CHANGED], 0);
+ }
+@@ -830,7 +845,7 @@
+ {
+ 	show_image_thumbs = eel_preferences_get_enum (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS);
+ 
+-	nautilus_icon_factory_clear ();
++	nautilus_icon_factory_clear (TRUE);
+ 	/* If the user disabled thumbnailing, remove all outstanding thumbnails */ 
+ 	if (show_image_thumbs == NAUTILUS_SPEED_TRADEOFF_NEVER) {
+ 		nautilus_thumbnail_remove_all_from_queue ();
+@@ -848,7 +863,7 @@
+ 	/* We don't know which data changed, so we have to assume that
+ 	 * any or all icons might have changed.
+ 	 */
+-	nautilus_icon_factory_clear ();
++	nautilus_icon_factory_clear (FALSE);
+ 	g_signal_emit (get_icon_factory (), 
+ 			 signals[ICONS_CHANGED], 0);
+ }				 
+--- libnautilus-private/nautilus-directory-async.c	2007/10/02 13:28:27	13248
++++ libnautilus-private/nautilus-directory-async.c	2007/10/02 13:28:59	13249
+@@ -594,7 +594,7 @@
+ 		NAUTILUS_FILE_ATTRIBUTE_FILE_TYPE |
+ 		NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES;
+ 
+-	nautilus_directory_invalidate_file_attributes (dir, attrs);
++	nautilus_directory_force_reload_internal (dir, attrs);
+ }
+ 
+ void




More information about the arch-commits mailing list