[Nautilus-list] [PATCH] Don't launch esd when not needed



Hello,

currently, when the preview signal is emitted from the nautilus icon
container, the signal handlericon_container_preview_callback checks if
sound is available before checking for the correct sound mime type. The
check starts the esound daemon even if the file isn't a music file at
all. This patch fixes the problem by checking for the correct mime type
before checking if sound is available.

//andersca
andersca gnu org 

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.4684
diff -u -r1.4684 ChangeLog
--- ChangeLog	2001/07/11 14:38:44	1.4684
+++ ChangeLog	2001/07/13 19:28:58
@@ -1,3 +1,10 @@
+2001-07-13  Anders Carlsson  <andersca codefactory se>
+
+	* src/file-manager/fm-icon-view.c (icon_container_preview_callback): Check
+	that the file mime type is correct (that the files is a music file) before calling 
+	nautilus_sound_can_play_sound () since that function launches esd which we
+	don't want to do unless we have a music file.
+
 2001-07-11  Alex Larsson  <alexl redhat com>
 
 	* acconfig.h:
Index: src/file-manager/fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.207
diff -u -r1.207 fm-icon-view.c
--- src/file-manager/fm-icon-view.c	2001/05/23 00:03:01	1.207
+++ src/file-manager/fm-icon-view.c	2001/07/13 19:28:58
@@ -1685,13 +1685,14 @@
 	
 	/* preview files based on the mime_type. */
 	/* at first, we just handle sounds */
-	if (should_preview_sound (file)
-	    && nautilus_sound_can_play_sound ()) {
+	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/x-ogg"))
 		    && eel_strcasecmp (mime_type, "audio/x-pn-realaudio") != 0
-		    && eel_strcasecmp (mime_type, "audio/x-mpegurl") != 0) {
+		    && eel_strcasecmp (mime_type, "audio/x-mpegurl") != 0
+		    && nautilus_sound_can_play_sound ()) {
 			result = 1;
 			preview_audio (icon_view, file, start_flag);
 		}	


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