should we extend priority use in gnome-vfs.mime ?
- From: Christophe Fergeau <teuf users sourceforge net>
- To: gnome-vfs-list gnome org
- Subject: should we extend priority use in gnome-vfs.mime ?
- Date: 25 Nov 2002 22:49:58 +0100
Hi,
I rolled up this patch for gnome-mime-data which removes the .it
extension from it, and removes a few unnecessary uppercase extensions.
But I thought a little more about the .it extension issue, and thought
that it may be more clever to fix it another way.
Currently, gnome-vfs uses the following scheme when it is asked for a
file mime-type:
* try to sniff the mime-type
* if it fails, check to see if it has an extension which had a priority
of 2 in gnome-vfs.mime
* if nothing is found, do the same with extensions of priority 1
* otherwise, check if a regexp matches the filename
* finally use the result of text mime-sniffing
This fixed scheme has 2 problems:
* the it problem which is caused by the fact that we can't say that for
a given extension, text sniffing takes precedence over the extension
match
* gzipped files need to be handled differently since we can't specify
that for example gzipped abiword files should be detected using their
extension, not mime-sniffing.
So I was wondering if it would be a good idea to extend the current
priority stuff for extensions to add a priority 0 which would tell
gnome-vfs that for these extensions it should prefer text sniffing
result instead of the extension match result). This one would be used to
handle the .it case for example. A priority 3 could also be added to
tell gnome-vfs that it should prefer extension matching over
mime-sniffing (this can be used to remove the special-casing of gzipped
files in the current gnome-vfs code). One drawback if we go that way is
that someone will have to go through gnome-vfs.mime to change the
priority of files that can be gzipped.
Any opinion ? is it worth implementing that (that doens't look to
difficult) or is it overkill ? and how does it fit in the feature freeze
(to my eyes that is a bug fix so that's ok) ?
Christophe
? autom4te.cache
? mime.diff
? tex.diff
Index: gnome-vfs.mime
===================================================================
RCS file: /cvs/gnome/gnome-mime-data/gnome-vfs.mime,v
retrieving revision 1.49
diff -u -d -b -u -r1.49 gnome-vfs.mime
--- gnome-vfs.mime 25 Oct 2002 14:32:13 -0000 1.49
+++ gnome-vfs.mime 24 Nov 2002 14:33:33 -0000
@@ -184,7 +184,7 @@
ext: spd
application/x-font-ttf
- ext: ttf TTF
+ ext: ttf
application/x-font-type1
ext: pfa pfb
@@ -365,14 +365,11 @@
audio/x-aiff
ext: aif aifc aiff
-audio/x-it
- ext: it IT
-
audio/x-midi
ext: midi mid
audio/x-mod
- ext: mod MOD
+ ext: mod
audio/x-mp3
ext: mp3
@@ -387,13 +384,13 @@
ext: rm ra ram
audio/x-s3m
- ext: S3M s3m
+ ext: s3m
audio/x-scpls
ext: pls
audio/x-stm
- ext: STM stm
+ ext: stm
audio/x-ulaw
ext: au
@@ -408,7 +405,7 @@
ext: xi
audio/x-xm
- ext: xm XM
+ ext: xm
image/bmp
@@ -476,10 +473,10 @@
ext: ico
image/x-iff
- ext: iff IFF
+ ext: iff
image/x-ilbm
- ext: ilbm ILBM
+ ext: ilbm
image/x-lwo
ext: lwo lwob
@@ -569,13 +566,13 @@
ext: css
text/html
- ext: html htm HTML
+ ext: html htm
text/mathml
ext: mml
text/plain
- ext: asc txt TXT
+ ext: asc txt
text/richtext
ext: rtx
@@ -599,7 +596,7 @@
ext: cc C cpp c++
text/x-c-header
- ext: h H h++ hpp
+ ext: h h++ hpp
text/x-comma-separated-values
ext: csv
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]