After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 121553 - GnomeVFS Should Use Mime Types for URI Schemes
GnomeVFS Should Use Mime Types for URI Schemes
Status: RESOLVED WONTFIX
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
cvs (head)
Other All
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-05 16:10 UTC by Rodney Dawes
Modified: 2008-09-06 19:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to Allow Mime Types for URI Schemes (683 bytes, patch)
2003-09-05 16:11 UTC, Rodney Dawes
none Details | Review
Patch to Only Change URL Showing Code in 2.4 (870 bytes, patch)
2003-09-11 02:13 UTC, Rodney Dawes
none Details | Review

Description Rodney Dawes 2003-09-05 16:10:34 UTC
The gnome-vfs mime system should use mime types for uri schemes, rather
than using url handlers gconf keys. Attached is a patch which allows this
to happen. Using mime types for uri schemes allows several things to
happen. The foremost being that multiple applications can register as
handling the mime type, as opposed to having the ability for only one thing
to own a gconf key. This patch also fixes what may result in segfaults on
Solaris and other similar systems, where printing a NULL string will cause
a SEGV, since gnome_vfs_get_mime_type () will return
application/octet-stream for things that it can't get a GnomeVFSFileInfo
for, such as a mailto: URI, as the default, instead of NULL. However, the
patch doesn't break the current behaviour, so it can still use the
url-handlers tree in gconf also. It would be very useful if this could go
into 2.4 proper.
Comment 1 Rodney Dawes 2003-09-05 16:11:29 UTC
Created attachment 19770 [details] [review]
Patch to Allow Mime Types for URI Schemes
Comment 2 Christophe Fergeau 2003-09-06 14:41:55 UTC
Can you explain more what you mean by "The gnome-vfs mime system
should use mime types for uri schemes, rather than using url handlers
gconf keys." ? Do you mean that gnome-vfs should mime sniff stuff like
http://www.gnome.org to find out it must open it in the text/html
handler ?
Comment 3 Rodney Dawes 2003-09-06 19:53:04 UTC
Yes. But it already does that. I am talking about all URI schemes, not
just things where there are gnome-vfs modules, and that have actual
data that can be read, aside from the fact that http "sniffing" is
just using whatever the server returns in the Content-Type: header,
which is very often incorrect. What I mean here is that we should get
rid of the url handlers gconf keys, and move everything over to using
mime types as representations of URI schemes, such that
"mailto:foo@bar.com" would end up being the "text/x-url-mailto" mime
type, or something similar, depending on what applications are
installed, and what the various RFCs and other documents say about
naming these mime types. This patch is just a start in that direction,
as it allows mime types to be resolved by the uri scheme, and fixes a
small portability issue.
Comment 4 Rodney Dawes 2003-09-09 19:53:06 UTC
Can I commit this yet?
Comment 5 Christophe Fergeau 2003-09-09 21:19:49 UTC
Imo this patch can't go in, since you want to change the behaviour of
a public function. I feel it's up to the app using this API to do
whatever they feel appropriate when NULL is returned.
As a side note, the current plan is to redesign the mime system during
2.5 development, hopefully your issue will be resolved at the same time
Comment 6 Rodney Dawes 2003-09-11 02:13:26 UTC
Created attachment 19854 [details] [review]
Patch to Only Change URL Showing Code in 2.4
Comment 7 Rodney Dawes 2003-09-11 02:16:52 UTC
This patch only affects the gnome_vfs_url_show_with_env () function,
and allows it to use mime types for URIs, rather than changing all of
gnome_vfs_get_mime_type () to behave more sanely. With this patch, the
handling of a NULL return from _get_mime_type () is changed to fall
back to doing _get_mime_type_internal (), so that URIs that gnome-vfs
may not handle, can still be opened with the proper application.
Comment 8 Christophe Fergeau 2003-09-11 17:32:32 UTC
I'm not sure mapping mime types to random pseudo-uri schemes is the
way to go. 
But I think you raised a valid point: you can specify in a
.applications file that an app can handle various uri schemes, but the
current gnome_vfs_url_show code doesn't seem to take that into account. 
For example, totem has
supported_uri_schemes=rtp,mms,net,http,file,ssh,smb,ftp,nntp
but I suspect gnome_open rtp://... won't work
This is probably what should be fixed and this would probably also do
what you want, but I'm not sure it's really easy to do.
How does that sound?
Comment 9 Rodney Dawes 2003-09-24 13:12:38 UTC
I am not sure that I would call something suggested by the w3c as
"random pseudo-uri schemes". And in fact, it would be best to be able
to dynamically update the mime database with what protocols a
particular application does support. For instance, if you build totem
without the xine backend, mms, and net, most likely will not work at
all, though they would still be specified in the file. Fixing
gnome-open to do some better fallback stuff is trivial, really, but I
doubt that it's the best solution, and rather only a temporary
workaround. Though, the patch that I made is just a similar temporary
workaround. I would love to fix this The Right Way (TM) for 2.6, but
it looks like that may also not happen. :-/ I will try to look at the
shared mime database stuff as soon as I can, but as far as I can tell
from what little I have seen of it, it only handls mime types, and
doesn't handle the application registry.
Comment 10 Christophe Fergeau 2003-09-24 13:29:31 UTC
> I would love to fix this The Right Way (TM) for 2.6

Which is ?

> it only handls mime types, and doesn't handle the application registry.

See http://cfergeau.free.fr/mime-spec-0.2.txt and xdg-list archives
for the beginning of a discussion about that.





Comment 11 Christian Neumair 2006-04-06 15:11:31 UTC
http://cfergeau.free.fr/mime-spec-0.2.txt yields 404 :/.
Comment 12 André Klapper 2008-09-06 19:17:36 UTC
gnome-vfs has been deprecated and superseded by gio/gvfs since GNOME 2.22, hence mass-closing many of the gnome-vfs requests/bug reports. This means that gnome-vfs is NOT actively maintained anymore, however patches are still welcome.

If your reported issue is still valid for gio/gvfs, please feel free to file a bug report against glib/gio or gvfs.

@Bugzilla mail recipients: query for gnome-vfs-mass-close to get rid of these notification emails all together.


General further information: http://en.wikipedia.org/wiki/GVFS 
Reasons behind this decision are listed at http://www.mail-archive.com/gnome-vfs-list@gnome.org/msg00899.html