Re: mime_type_is_known()



The (untested) attached patch should fix the issue, can you test it?

Christophe

Le lundi 30 août 2004 à 14:21 -0500, Bryan Forbes a écrit :
> I was working on Coaster today and I had recently upgraded to gnome-vfs
> 2.7 and I got a warning from bakery about an mime-type that was unknown.
> I checked and all the mime-types that coaster uses are registered
> correctly and nautilus reports them correctly.  I started digging and
> found that bakery uses Gnome::Vfs::Mime::type_is_known(), which wraps
> gnome_vfs_mime_type_is_known().  I opened up the source to that function
> and saw this:
> 
> gboolean
> gnome_vfs_mime_type_is_known (const char *mime_type)
> {
> 	if (mime_type == NULL) {
> 		return FALSE;
> 	}
> 
> 	g_return_val_if_fail (!does_string_contain_caps (mime_type),
> 			      FALSE);
> 
> 	if (!gnome_vfs_mime_inited)
> 		gnome_vfs_mime_init ();
> 
> 	reload_if_needed ();
> 
> 	return FALSE;
> }
> 
> Why does this function always return false?  If this is the correct
> behavior for this function, is there a way to tell if an mime-type is
> known?
> 
> _______________________________________________
> gnome-vfs-list mailing list
> gnome-vfs-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-vfs-list
? attachment.cgi?id=29485
? attachment.cgi?id=29883
? attachment.cgi?id=30185
? attachment.cgi?id=30321
? attachment.cgi?id=30459
? attachment.cgi?id=30530
? build.diff
? cdda.diff
? freespace.diff
? gnome-vfs-2.7.90.tar.gz
? gnomemedia.diff
? known_mime_type.diff
? mime-lockup.diff
? sftp.diff
? unref.diff
? vfs-doc.diff
? vfsdoc.diff
? xer.diff
? xfer.diff
? doc/unused.txt
? imported/Makefile
? imported/Makefile.in
? imported/neon/Makefile.in
? libgnomevfs/s-enum-types-c
? libgnomevfs/s-enum-types-h
? modules/fileoffset.diff
? modules/solaris.diff
? modules/extfs/Makefile
? modules/extfs/Makefile.in
? modules/extfs/ar
? modules/extfs/cpio
? modules/extfs/deb
? modules/extfs/lha
? modules/extfs/rar
? modules/extfs/zip
? modules/extfs/zoo
? test/test-dns-sd
? test/test-mime-info-cache
Index: libgnomevfs/gnome-vfs-mime-info.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-mime-info.c,v
retrieving revision 1.79
diff -u -r1.79 gnome-vfs-mime-info.c
--- libgnomevfs/gnome-vfs-mime-info.c	26 Jul 2004 19:31:36 -0000	1.79
+++ libgnomevfs/gnome-vfs-mime-info.c	31 Aug 2004 20:36:26 -0000
@@ -588,8 +588,8 @@
 		gnome_vfs_mime_init ();
 
 	reload_if_needed ();
-
-	return FALSE;
+	
+	return (get_entry (mime_type) != NULL);
 }
 
 /**

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=



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