1 |
dang 07/10/29 17:28:02 |
2 |
|
3 |
Added: nautilus-2.20.0-async-thumbnail-framing.patch |
4 |
nautilus-2.20.0-small-font-crasher.patch |
5 |
digest-nautilus-2.20.0-r1 |
6 |
nautilus-2.20.0-thumbnail-flashing.patch |
7 |
nautilus-2.20.0-sound-preview-cleanup.patch |
8 |
Log: |
9 |
Bump to 2.20.0-r1 |
10 |
* Crash with small fonts (bugs.gnome.org #454884) (thanks plaes) |
11 |
* Thumbnails not showing (bugs.gnome.org #480608) (thanks plaes) |
12 |
* Missing thumbnail frames (bugs.gnome.org #478363) (thanks plaes) |
13 |
* Add new gstreamer/totem support for sound previews; bug #196822 |
14 |
|
15 |
(Portage version: 2.1.3.16) |
16 |
|
17 |
Revision Changes Path |
18 |
1.1 gnome-base/nautilus/files/nautilus-2.20.0-async-thumbnail-framing.patch |
19 |
|
20 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-async-thumbnail-framing.patch?rev=1.1&view=markup |
21 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-async-thumbnail-framing.patch?rev=1.1&content-type=text/plain |
22 |
|
23 |
Index: nautilus-2.20.0-async-thumbnail-framing.patch |
24 |
=================================================================== |
25 |
* libnautilus-private/nautilus-icon-factory.c: |
26 |
(async_thumbnail_load_func): Frame asynchronously loaded thumbnails. |
27 |
Fixes #478363 |
28 |
--- libnautilus-private/nautilus-icon-factory.c 2007/09/27 17:15:05 13235 |
29 |
+++ libnautilus-private/nautilus-icon-factory.c 2007/09/27 17:19:21 13236 |
30 |
@@ -384,9 +384,21 @@ |
31 |
goto out; |
32 |
} |
33 |
|
34 |
+ if (!gdk_pixbuf_get_has_alpha (pixbuf)) { |
35 |
+ /* we don't own the pixbuf, but nautilus_thumbnail_frame_image() assumes so and unrefs it. */ |
36 |
+ g_object_ref (pixbuf); |
37 |
+ |
38 |
+ nautilus_thumbnail_frame_image (&pixbuf); |
39 |
+ /* at this point, we own a pixbuf, which is the framed version of the passed-in pixbuf. */ |
40 |
+ } |
41 |
+ |
42 |
cached_icon = cache_icon_new (pixbuf, NULL, scale_x, scale_y); |
43 |
cached_icon->mtime = statbuf.st_mtime; |
44 |
|
45 |
+ if (!gdk_pixbuf_get_has_alpha (pixbuf)) { |
46 |
+ g_object_unref (pixbuf); |
47 |
+ } |
48 |
+ |
49 |
if (cached_icon != NULL) { |
50 |
key = g_new (CacheKey, 1); |
51 |
key->name = g_strdup (path); |
52 |
|
53 |
|
54 |
|
55 |
1.1 gnome-base/nautilus/files/nautilus-2.20.0-small-font-crasher.patch |
56 |
|
57 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-small-font-crasher.patch?rev=1.1&view=markup |
58 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-small-font-crasher.patch?rev=1.1&content-type=text/plain |
59 |
|
60 |
Index: nautilus-2.20.0-small-font-crasher.patch |
61 |
=================================================================== |
62 |
Fix crash with small fonts (#454884) |
63 |
--- src/nautilus-sidebar-title.c 2007/10/03 06:38:48 13255 |
64 |
+++ src/nautilus-sidebar-title.c 2007/10/03 06:39:37 13256 |
65 |
@@ -364,7 +364,7 @@ |
66 |
title_font = pango_font_description_copy (style->font_desc); |
67 |
|
68 |
max_style_font_size = pango_font_description_get_size (title_font) * 1.8 / PANGO_SCALE; |
69 |
- if (max_style_font_size < MIN_TITLE_FONT_SIZE) { |
70 |
+ if (max_style_font_size < MIN_TITLE_FONT_SIZE + 1) { |
71 |
max_style_font_size = MIN_TITLE_FONT_SIZE + 1; |
72 |
} |
73 |
|
74 |
|
75 |
|
76 |
|
77 |
1.1 gnome-base/nautilus/files/digest-nautilus-2.20.0-r1 |
78 |
|
79 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/digest-nautilus-2.20.0-r1?rev=1.1&view=markup |
80 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/digest-nautilus-2.20.0-r1?rev=1.1&content-type=text/plain |
81 |
|
82 |
Index: digest-nautilus-2.20.0-r1 |
83 |
=================================================================== |
84 |
MD5 3856ec2ffeba786d12f8f6622e398c33 nautilus-2.20.0.tar.bz2 4916284 |
85 |
RMD160 9eeb18c886795ebbdd6dfc61ccddaee8eab81808 nautilus-2.20.0.tar.bz2 4916284 |
86 |
SHA256 98f9d9f7bc89db67cbcc4c7d08ec72175b8c9b3eb9489f7869c5cec9f16feb08 nautilus-2.20.0.tar.bz2 4916284 |
87 |
|
88 |
|
89 |
|
90 |
1.1 gnome-base/nautilus/files/nautilus-2.20.0-thumbnail-flashing.patch |
91 |
|
92 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-thumbnail-flashing.patch?rev=1.1&view=markup |
93 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-thumbnail-flashing.patch?rev=1.1&content-type=text/plain |
94 |
|
95 |
Index: nautilus-2.20.0-thumbnail-flashing.patch |
96 |
=================================================================== |
97 |
2007-10-02 Frederic Crozat <fcrozat@××××××××.com> |
98 |
|
99 |
Backport from gio-branch, fixes #480608, from |
100 |
Alexander Larsson <alexl@××××××.com> |
101 |
|
102 |
* libnautilus-private/nautilus-icon-factory.c: |
103 |
Don't clear thumbnails and other absolute pathnames from icon |
104 |
cache when mime data or icon theme changes. This is to avoid |
105 |
flashing and async realoading of all thumbnails. |
106 |
|
107 |
* libnautilus-private/nautilus-directory-async.c: |
108 |
(mime_db_changed_callback): |
109 |
Use the right call to invalidate attributes, so that |
110 |
they get re-read correctly. |
111 |
--- libnautilus-private/nautilus-icon-factory.c 2007/10/02 13:28:27 13248 |
112 |
+++ libnautilus-private/nautilus-icon-factory.c 2007/10/02 13:28:59 13249 |
113 |
@@ -200,7 +200,7 @@ |
114 |
const char *modifier, |
115 |
guint nominal_size, |
116 |
gboolean force_nominal); |
117 |
-static void nautilus_icon_factory_clear (void); |
118 |
+static void nautilus_icon_factory_clear (gboolean clear_pathnames); |
119 |
|
120 |
GNOME_CLASS_BOILERPLATE (NautilusIconFactory, |
121 |
nautilus_icon_factory, |
122 |
@@ -270,7 +270,7 @@ |
123 |
{ |
124 |
NautilusIconFactory *factory; |
125 |
|
126 |
- nautilus_icon_factory_clear (); |
127 |
+ nautilus_icon_factory_clear (FALSE); |
128 |
|
129 |
factory = user_data; |
130 |
|
131 |
@@ -726,9 +726,23 @@ |
132 |
return TRUE; |
133 |
} |
134 |
|
135 |
-/* Reset the cache to the default state. */ |
136 |
+static gboolean |
137 |
+remove_non_pathnames (gpointer _key, gpointer value, gpointer user_data) |
138 |
+{ |
139 |
+ CacheKey *key = _key; |
140 |
+ |
141 |
+ if (key->name && key->name[0] == '/') { |
142 |
+ return FALSE; |
143 |
+ } |
144 |
+ |
145 |
+ return TRUE; /* Tell the caller to remove the hash table entry. */ |
146 |
+} |
147 |
+ |
148 |
+/* Reset the cache to the default state. |
149 |
+ Clear pathnames can be set to FALSE which means we only clear icon names, not |
150 |
+ absolute pathnames. This is useful to avoid throwing away all loaded thumbnails. */ |
151 |
static void |
152 |
-nautilus_icon_factory_clear (void) |
153 |
+nautilus_icon_factory_clear (gboolean clear_pathnames) |
154 |
{ |
155 |
NautilusIconFactory *factory; |
156 |
CircularList *head; |
157 |
@@ -736,24 +750,25 @@ |
158 |
factory = get_icon_factory (); |
159 |
|
160 |
g_hash_table_foreach_remove (factory->icon_cache, |
161 |
- remove_all, |
162 |
+ clear_pathnames ? remove_all : remove_non_pathnames, |
163 |
NULL); |
164 |
|
165 |
/* Empty out the recently-used list. */ |
166 |
head = &factory->recently_used_dummy_head; |
167 |
|
168 |
- /* fallback_icon hangs around, but we don't know if it |
169 |
- * was ever inserted in the list |
170 |
- */ |
171 |
- g_assert (factory->recently_used_count == 0 || |
172 |
- factory->recently_used_count == 1); |
173 |
- |
174 |
- if (factory->recently_used_count == 1) { |
175 |
- /* make sure this one is the fallback_icon */ |
176 |
- g_assert (head->next == head->prev); |
177 |
- g_assert (&factory->fallback_icon->recently_used_node == head->next); |
178 |
+ if (clear_pathnames) { |
179 |
+ /* fallback_icon hangs around, but we don't know if it |
180 |
+ * was ever inserted in the list |
181 |
+ */ |
182 |
+ g_assert (factory->recently_used_count == 0 || |
183 |
+ factory->recently_used_count == 1); |
184 |
+ if (factory->recently_used_count == 1) { |
185 |
+ /* make sure this one is the fallback_icon */ |
186 |
+ g_assert (head->next == head->prev); |
187 |
+ g_assert (&factory->fallback_icon->recently_used_node == head->next); |
188 |
+ } |
189 |
} |
190 |
- |
191 |
+ |
192 |
} |
193 |
|
194 |
static void |
195 |
@@ -806,7 +821,7 @@ |
196 |
* signal to mean only "thumbnails might have changed" if this ends up being slow |
197 |
* for some reason. |
198 |
*/ |
199 |
- nautilus_icon_factory_clear (); |
200 |
+ nautilus_icon_factory_clear (TRUE); |
201 |
g_signal_emit (global_icon_factory, |
202 |
signals[ICONS_CHANGED], 0); |
203 |
} |
204 |
@@ -820,7 +835,7 @@ |
205 |
* signal to mean only "thumbnails might have changed" if this ends up being slow |
206 |
* for some reason. |
207 |
*/ |
208 |
- nautilus_icon_factory_clear (); |
209 |
+ nautilus_icon_factory_clear (TRUE); |
210 |
g_signal_emit (global_icon_factory, |
211 |
signals[ICONS_CHANGED], 0); |
212 |
} |
213 |
@@ -830,7 +845,7 @@ |
214 |
{ |
215 |
show_image_thumbs = eel_preferences_get_enum (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS); |
216 |
|
217 |
- nautilus_icon_factory_clear (); |
218 |
+ nautilus_icon_factory_clear (TRUE); |
219 |
/* If the user disabled thumbnailing, remove all outstanding thumbnails */ |
220 |
if (show_image_thumbs == NAUTILUS_SPEED_TRADEOFF_NEVER) { |
221 |
nautilus_thumbnail_remove_all_from_queue (); |
222 |
@@ -848,7 +863,7 @@ |
223 |
/* We don't know which data changed, so we have to assume that |
224 |
* any or all icons might have changed. |
225 |
*/ |
226 |
- nautilus_icon_factory_clear (); |
227 |
+ nautilus_icon_factory_clear (FALSE); |
228 |
g_signal_emit (get_icon_factory (), |
229 |
signals[ICONS_CHANGED], 0); |
230 |
} |
231 |
--- libnautilus-private/nautilus-directory-async.c 2007/10/02 13:28:27 13248 |
232 |
+++ libnautilus-private/nautilus-directory-async.c 2007/10/02 13:28:59 13249 |
233 |
@@ -594,7 +594,7 @@ |
234 |
NAUTILUS_FILE_ATTRIBUTE_FILE_TYPE | |
235 |
NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES; |
236 |
|
237 |
- nautilus_directory_invalidate_file_attributes (dir, attrs); |
238 |
+ nautilus_directory_force_reload_internal (dir, attrs); |
239 |
} |
240 |
|
241 |
void |
242 |
|
243 |
|
244 |
|
245 |
1.1 gnome-base/nautilus/files/nautilus-2.20.0-sound-preview-cleanup.patch |
246 |
|
247 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-sound-preview-cleanup.patch?rev=1.1&view=markup |
248 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/nautilus/files/nautilus-2.20.0-sound-preview-cleanup.patch?rev=1.1&content-type=text/plain |
249 |
|
250 |
Index: nautilus-2.20.0-sound-preview-cleanup.patch |
251 |
=================================================================== |
252 |
diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN nautilus-2.20.0.orig/configure.in nautilus-2.20.0/configure.in |
253 |
--- nautilus-2.20.0.orig/configure.in 2007-09-18 02:55:14.000000000 -0400 |
254 |
+++ nautilus-2.20.0/configure.in 2007-10-29 10:50:48.000000000 -0400 |
255 |
@@ -90,7 +90,6 @@ fi |
256 |
AC_SUBST(STARTUP_NOTIFICATION_PACKAGE) |
257 |
|
258 |
PKG_CHECK_MODULES(ALL, [ |
259 |
- esound >= esound_minver |
260 |
bonobo-activation-2.0 >= bonobo_activation_minver |
261 |
eel-2.0 >= eel_minver |
262 |
glib-2.0 >= glib_minver |
263 |
@@ -312,6 +311,25 @@ fi |
264 |
|
265 |
dnl ========================================================================== |
266 |
|
267 |
+AM_CONDITIONAL(HAVE_ESOUND, false) |
268 |
+ |
269 |
+dnl esound checking |
270 |
+ |
271 |
+AC_ARG_ENABLE(esound, [ --disable-esound build without esound support]) |
272 |
+msg_esound=no |
273 |
+if test "x$enable_esound" != "xno"; then |
274 |
+ PKG_CHECK_MODULES(ESOUND, esound >= esound_minver, [ |
275 |
+ AM_CONDITIONAL(HAVE_ESOUND, true) |
276 |
+ AC_DEFINE(HAVE_ESOUND, 1, [Define to enable esound support]) |
277 |
+ ] |
278 |
+ msg_esound=yes, |
279 |
+ [AM_CONDITIONAL(HAVE_ESOUND, false)]) |
280 |
+ AC_SUBST(ESOUND_CFLAGS) |
281 |
+ AC_SUBST(ESOUND_LIBS) |
282 |
+fi |
283 |
+ |
284 |
+dnl ========================================================================== |
285 |
+ |
286 |
dnl **************************** |
287 |
dnl *** Check for libselinux *** |
288 |
dnl **************************** |
289 |
@@ -404,7 +422,7 @@ LIBNAUTILUS_EXTENSION_LIBS="`$PKG_CONFIG |
290 |
AC_SUBST(LIBNAUTILUS_EXTENSION_LIBS) |
291 |
|
292 |
dnl core nautilus (must list bonobo-activation and libbonobo because idldir does not respect "requires") |
293 |
-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" |
294 |
+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" |
295 |
CORE_CFLAGS="`$PKG_CONFIG --cflags $CORE_MODULES` $x_cflags $WARNING_CFLAGS" |
296 |
AC_SUBST(CORE_CFLAGS) |
297 |
CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $x_libs" |
298 |
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 |
299 |
--- nautilus-2.20.0.orig/libnautilus-private/Makefile.am 2007-08-21 05:37:54.000000000 -0400 |
300 |
+++ nautilus-2.20.0/libnautilus-private/Makefile.am 2007-10-29 10:50:48.000000000 -0400 |
301 |
@@ -10,6 +10,7 @@ INCLUDES = \ |
302 |
$(DISABLE_DEPRECATED_CFLAGS) \ |
303 |
$(TRACKER_CFLAGS) \ |
304 |
$(BEAGLE_CFLAGS) \ |
305 |
+ $(ESOUND_CFLAGS) \ |
306 |
-DDATADIR=\""$(datadir)"\" \ |
307 |
-DSYSCONFDIR=\""$(sysconfdir)"\" \ |
308 |
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ |
309 |
@@ -31,6 +32,7 @@ libnautilus_private_la_LIBADD = \ |
310 |
$(SELINUX_LIBS) \ |
311 |
$(BEAGLE_LIBS) \ |
312 |
$(TRACKER_LIBS) \ |
313 |
+ $(ESOUND_LIBS) \ |
314 |
$(top_builddir)/libnautilus-extension/libnautilus-extension.la \ |
315 |
$(CORE_LIBS) \ |
316 |
$(NULL) |
317 |
@@ -49,8 +51,6 @@ marshal_sources = \ |
318 |
|
319 |
libnautilus_private_la_SOURCES = \ |
320 |
$(nautilus_metafile_server_idl_sources) \ |
321 |
- nautilus-audio-player.c \ |
322 |
- nautilus-audio-player.h \ |
323 |
nautilus-bookmark.c \ |
324 |
nautilus-bookmark.h \ |
325 |
nautilus-cell-renderer-pixbuf-emblem.c \ |
326 |
@@ -228,6 +228,14 @@ if HAVE_TRACKER |
327 |
libnautilus_private_la_SOURCES += $(TRACKER_SOURCES) |
328 |
endif |
329 |
|
330 |
+ESOUND_SOURCES = \ |
331 |
+ nautilus-audio-player.c \ |
332 |
+ nautilus-audio-player.h |
333 |
+ |
334 |
+if HAVE_ESOUND |
335 |
+libnautilus_private_la_SOURCES += $(ESOUND_SOURCES) |
336 |
+endif |
337 |
+ |
338 |
$(lib_LTLIBRARIES): $(dependency_static_libs) |
339 |
|
340 |
$(nautilus_metafile_server_idl_sources): nautilus_metafile_server_idl_stamp |
341 |
@@ -264,6 +272,7 @@ EXTRA_DIST = \ |
342 |
nautilus-marshal.list \ |
343 |
$(schema_in_files) \ |
344 |
$(BEAGLE_SOURCES) \ |
345 |
+ $(ESOUND_SOURCES) \ |
346 |
$(TRACKER_SOURCES) \ |
347 |
$(NULL) |
348 |
|
349 |
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 |
350 |
--- nautilus-2.20.0.orig/src/file-manager/fm-icon-view.c 2007-04-03 06:08:04.000000000 -0400 |
351 |
+++ nautilus-2.20.0/src/file-manager/fm-icon-view.c 2007-10-29 12:02:21.000000000 -0400 |
352 |
@@ -24,6 +24,7 @@ |
353 |
|
354 |
#include <config.h> |
355 |
#include "fm-icon-view.h" |
356 |
+#include "nautilus-audio-mime-types.h" |
357 |
|
358 |
#include "fm-actions.h" |
359 |
#include "fm-icon-container.h" |
360 |
@@ -78,7 +79,9 @@ |
361 |
#include <sys/types.h> |
362 |
#include <sys/wait.h> |
363 |
#include <unistd.h> |
364 |
+#ifdef HAVE_ESOUND |
365 |
#include <esd.h> |
366 |
+#endif |
367 |
|
368 |
#define USE_OLD_AUDIO_PREVIEW 1 |
369 |
#define READ_CHUNK_SIZE 16384 |
370 |
@@ -165,9 +168,8 @@ static const SortCriterion sort_criteria |
371 |
|
372 |
static gboolean default_sort_in_reverse_order = FALSE; |
373 |
static int preview_sound_auto_value; |
374 |
-static gboolean gnome_esd_enabled_auto_value; |
375 |
|
376 |
-#if USE_OLD_AUDIO_PREVIEW |
377 |
+#ifndef HAVE_ESOUND |
378 |
static pid_t audio_preview_pid = 0; |
379 |
#endif |
380 |
|
381 |
@@ -1747,60 +1749,59 @@ band_select_ended_callback (NautilusIcon |
382 |
|
383 |
/* handle the preview signal by inspecting the mime type. For now, we only preview local sound files. */ |
384 |
|
385 |
+#ifndef HAVE_ESOUND |
386 |
+static char * |
387 |
+get_preview_command (void) |
388 |
+{ |
389 |
+ char *command; |
390 |
+ |
391 |
+ command = g_find_program_in_path ("totem-audio-preview"); |
392 |
+ if (command) |
393 |
+ return command; |
394 |
+ command = g_find_program_in_path ("gst-launch-0.10"); |
395 |
+ if (command) { |
396 |
+ char *new_cmd; |
397 |
+ |
398 |
+ new_cmd = g_strdup_printf ("%s playbin uri=fd://0", command); |
399 |
+ g_free (command); |
400 |
+ return new_cmd; |
401 |
+ } |
402 |
+ |
403 |
+ return NULL; |
404 |
+} |
405 |
+#endif /* !HAVE_ESOUND */ |
406 |
+ |
407 |
/* here's the timer task that actually plays the file using mpg123, ogg123 or play. */ |
408 |
/* FIXME bugzilla.gnome.org 41258: we should get the application from our mime-type stuff */ |
409 |
static gboolean |
410 |
play_file (gpointer callback_data) |
411 |
{ |
412 |
-#if USE_OLD_AUDIO_PREVIEW |
413 |
+#ifndef HAVE_ESOUND |
414 |
NautilusFile *file; |
415 |
FMIconView *icon_view; |
416 |
FILE *sound_process; |
417 |
char *file_uri; |
418 |
- char *suffix; |
419 |
- char *mime_type; |
420 |
- const char *command_str; |
421 |
- gboolean is_mp3; |
422 |
- gboolean is_ogg; |
423 |
+ char *command_str; |
424 |
pid_t mp3_pid; |
425 |
|
426 |
GnomeVFSResult result; |
427 |
GnomeVFSHandle *handle; |
428 |
char *buffer; |
429 |
- const char *audio_device = NULL; |
430 |
GnomeVFSFileSize bytes_read; |
431 |
|
432 |
- audio_device = g_getenv ("AUDIODEV"); |
433 |
icon_view = FM_ICON_VIEW (callback_data); |
434 |
+ |
435 |
+ command_str = get_preview_command (); |
436 |
+ if (command_str == NULL) |
437 |
+ return FALSE; |
438 |
|
439 |
file = icon_view->details->audio_preview_file; |
440 |
file_uri = nautilus_file_get_uri (file); |
441 |
- mime_type = nautilus_file_get_mime_type (file); |
442 |
- is_mp3 = eel_strcasecmp (mime_type, "audio/mpeg") == 0; |
443 |
- is_ogg = eel_strcasecmp (mime_type, "application/ogg") == 0 || |
444 |
- eel_strcasecmp (mime_type, "application/x-ogg") == 0; |
445 |
|
446 |
mp3_pid = fork (); |
447 |
if (mp3_pid == (pid_t) 0) { |
448 |
/* Set the group (session) id to this process for future killing. */ |
449 |
setsid(); |
450 |
- if (is_mp3) { |
451 |
- command_str = "mpg123 -y -q -"; |
452 |
- } else if (is_ogg) { |
453 |
- command_str = "ogg123 -q -"; |
454 |
- } else { |
455 |
- suffix = strrchr(file_uri, '.'); |
456 |
- if (suffix == NULL) { |
457 |
- suffix = "wav"; |
458 |
- } else { |
459 |
- suffix += 1; /* skip the period */ |
460 |
- } |
461 |
- if (audio_device) { |
462 |
- command_str = g_strdup_printf("play -d %s -t %s -", audio_device, suffix); |
463 |
- } else { |
464 |
- command_str = g_strdup_printf("play -t %s -", suffix); |
465 |
- } |
466 |
- } |
467 |
|
468 |
/* read the file with gnome-vfs, feeding it to the sound player's standard input */ |
469 |
/* First, open the file. */ |
470 |
@@ -1851,10 +1852,10 @@ play_file (gpointer callback_data) |
471 |
} |
472 |
|
473 |
g_free (file_uri); |
474 |
- g_free (mime_type); |
475 |
+ g_free (command_str); |
476 |
|
477 |
icon_view->details->audio_preview_timeout = 0; |
478 |
-#else |
479 |
+#else /* HAVE_ESOUND */ |
480 |
char *file_path, *file_uri, *mime_type; |
481 |
gboolean is_mp3; |
482 |
FMIconView *icon_view; |
483 |
@@ -1893,13 +1894,13 @@ static void |
484 |
preview_audio (FMIconView *icon_view, NautilusFile *file, gboolean start_flag) |
485 |
{ |
486 |
/* Stop current audio playback */ |
487 |
-#if USE_OLD_AUDIO_PREVIEW |
488 |
+#ifndef HAVE_ESOUND |
489 |
if (audio_preview_pid > 0) { |
490 |
kill (-audio_preview_pid, SIGTERM); |
491 |
waitpid (audio_preview_pid, NULL, 0); |
492 |
audio_preview_pid = 0; |
493 |
} |
494 |
-#else |
495 |
+#else /* HAVE_ESOUND */ |
496 |
if (icon_view->details->audio_player_data != NULL) { |
497 |
nautilus_audio_player_stop (icon_view->details->audio_player_data); |
498 |
g_free (icon_view->details->audio_player_data); |
499 |
@@ -1913,9 +1914,9 @@ preview_audio (FMIconView *icon_view, Na |
500 |
|
501 |
if (start_flag) { |
502 |
icon_view->details->audio_preview_file = file; |
503 |
-#if USE_OLD_AUDIO_PREVIEW |
504 |
+#ifndef HAVE_ESOUND |
505 |
icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view); |
506 |
-#else |
507 |
+#else /* HAVE_ESOUND */ |
508 |
/* FIXME: Need to kill the existing timeout if there is one? */ |
509 |
icon_view->details->audio_preview_timeout = g_timeout_add (1000, play_file, icon_view); |
510 |
#endif |
511 |
@@ -1923,15 +1924,31 @@ preview_audio (FMIconView *icon_view, Na |
512 |
} |
513 |
|
514 |
static gboolean |
515 |
-should_preview_sound (NautilusFile *file) |
516 |
+sound_preview_type_supported (NautilusFile *file) |
517 |
{ |
518 |
- char *uri; |
519 |
+ char *mime_type; |
520 |
+ guint i; |
521 |
|
522 |
- /* Check gnome config sound preference */ |
523 |
- if (!gnome_esd_enabled_auto_value) { |
524 |
+ mime_type = nautilus_file_get_mime_type (file); |
525 |
+ if (mime_type == NULL) |
526 |
return FALSE; |
527 |
+ for (i = 0; i < G_N_ELEMENTS (audio_mime_types); i++) { |
528 |
+ GnomeVFSMimeEquivalence equivalence = gnome_vfs_mime_type_get_equivalence (mime_type, audio_mime_types[i]); |
529 |
+ if (equivalence == GNOME_VFS_MIME_IDENTICAL || equivalence == GNOME_VFS_MIME_PARENT) { |
530 |
+ g_free (mime_type); |
531 |
+ return TRUE; |
532 |
+ } |
533 |
} |
534 |
|
535 |
+ g_free (mime_type); |
536 |
+ return FALSE; |
537 |
+} |
538 |
+ |
539 |
+static gboolean |
540 |
+should_preview_sound (NautilusFile *file) |
541 |
+{ |
542 |
+ char *uri; |
543 |
+ |
544 |
uri = nautilus_file_get_uri (file); |
545 |
if (uri && eel_istr_has_prefix (uri, "burn:")) { |
546 |
g_free (uri); |
547 |
@@ -1956,12 +1973,9 @@ can_play_sound (void) |
548 |
{ |
549 |
int open_result; |
550 |
|
551 |
-#if USE_OLD_AUDIO_PREVIEW |
552 |
- /* first see if there's already one in progress; if so, return true */ |
553 |
- if (audio_preview_pid > 0) { |
554 |
- return TRUE; |
555 |
- } |
556 |
-#endif |
557 |
+#ifndef HAVE_ESOUND |
558 |
+ return TRUE; |
559 |
+#else /* HAVE_ESOUND */ |
560 |
|
561 |
/* Now check and see if system has audio out capabilites */ |
562 |
open_result = esd_open_sound (NULL); |
563 |
@@ -1972,6 +1986,7 @@ can_play_sound (void) |
564 |
esd_close (open_result); |
565 |
|
566 |
return TRUE; |
567 |
+#endif |
568 |
} |
569 |
|
570 |
static int |
571 |
@@ -1981,25 +1996,17 @@ icon_container_preview_callback (Nautilu |
572 |
FMIconView *icon_view) |
573 |
{ |
574 |
int result; |
575 |
- char *mime_type, *file_name, *message; |
576 |
+ char *file_name, *message; |
577 |
|
578 |
result = 0; |
579 |
|
580 |
/* preview files based on the mime_type. */ |
581 |
/* at first, we just handle sounds */ |
582 |
if (should_preview_sound (file)) { |
583 |
- mime_type = nautilus_file_get_mime_type (file); |
584 |
- |
585 |
- if ((eel_istr_has_prefix (mime_type, "audio/") |
586 |
- || eel_istr_has_prefix (mime_type, "application/ogg") |
587 |
- || eel_istr_has_prefix (mime_type, "application/x-ogg")) |
588 |
- && eel_strcasecmp (mime_type, "audio/x-pn-realaudio") != 0 |
589 |
- && eel_strcasecmp (mime_type, "audio/x-mpegurl") != 0 |
590 |
- && can_play_sound ()) { |
591 |
+ if (sound_preview_type_supported (file) && can_play_sound ()) { |
592 |
result = 1; |
593 |
preview_audio (icon_view, file, start_flag); |
594 |
} |
595 |
- g_free (mime_type); |
596 |
} |
597 |
|
598 |
/* Display file name in status area at low zoom levels, since |
599 |
@@ -2708,10 +2715,6 @@ fm_icon_view_init (FMIconView *icon_view |
600 |
eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_PREVIEW_SOUND, |
601 |
&preview_sound_auto_value); |
602 |
|
603 |
- eel_preferences_monitor_directory ("/desktop/gnome/sound"); |
604 |
- eel_preferences_add_auto_boolean ("/desktop/gnome/sound/enable_esd", |
605 |
- &gnome_esd_enabled_auto_value); |
606 |
- |
607 |
setup_sound_preview = TRUE; |
608 |
} |
609 |
|
610 |
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 |
611 |
--- nautilus-2.20.0.orig/src/file-manager/Makefile.am 2007-06-27 03:12:32.000000000 -0400 |
612 |
+++ nautilus-2.20.0/src/file-manager/Makefile.am 2007-10-29 10:55:00.000000000 -0400 |
613 |
@@ -38,6 +38,7 @@ libnautilus_file_manager_la_SOURCES= \ |
614 |
fm-tree-model.h \ |
615 |
fm-tree-view.c \ |
616 |
fm-tree-view.h \ |
617 |
+ nautilus-audio-mime-types.h \ |
618 |
$(NULL) |
619 |
|
620 |
EMPTY_VIEW_SOURCES = \ |
621 |
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 |
622 |
--- nautilus-2.20.0.orig/src/file-manager/nautilus-audio-mime-types.h 1969-12-31 19:00:00.000000000 -0500 |
623 |
+++ nautilus-2.20.0/src/file-manager/nautilus-audio-mime-types.h 2007-10-29 10:55:00.000000000 -0400 |
624 |
@@ -0,0 +1,41 @@ |
625 |
+/* generated with mime-types-include.sh in the totem module, don't edit or |
626 |
+ commit in the nautilus module without filing a bug against totem */ |
627 |
+static char *audio_mime_types[] = { |
628 |
+"audio/3gpp", |
629 |
+"audio/ac3", |
630 |
+"audio/AMR", |
631 |
+"audio/AMR-WB", |
632 |
+"audio/basic", |
633 |
+"audio/mp4", |
634 |
+"audio/mpeg", |
635 |
+"audio/mpegurl", |
636 |
+"audio/ogg", |
637 |
+"audio/vnd.rn-realaudio", |
638 |
+"audio/x-ape", |
639 |
+"audio/x-flac", |
640 |
+"audio/x-it", |
641 |
+"audio/x-m4a", |
642 |
+"audio/x-matroska", |
643 |
+"audio/x-mod", |
644 |
+"audio/x-mp3", |
645 |
+"audio/x-mpeg", |
646 |
+"audio/x-mpegurl", |
647 |
+"audio/x-ms-asf", |
648 |
+"audio/x-ms-asx", |
649 |
+"audio/x-ms-wax", |
650 |
+"audio/x-ms-wma", |
651 |
+"audio/x-musepack", |
652 |
+"audio/x-pn-aiff", |
653 |
+"audio/x-pn-au", |
654 |
+"audio/x-pn-wav", |
655 |
+"audio/x-pn-windows-acm", |
656 |
+"audio/x-realaudio", |
657 |
+"audio/x-real-audio", |
658 |
+"audio/x-sbc", |
659 |
+"audio/x-scpls", |
660 |
+"audio/x-tta", |
661 |
+"audio/x-wav", |
662 |
+"audio/x-wav", |
663 |
+"audio/x-wavpack", |
664 |
+"audio/x-vorbis", |
665 |
+}; |
666 |
|
667 |
|
668 |
|
669 |
-- |
670 |
gentoo-commits@g.o mailing list |