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 138359 - can't create new mime types with freedesktop.org mime database
can't create new mime types with freedesktop.org mime database
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
cvs (head)
Other Linux
: High major
: ---
Assigned To: gnome-vfs maintainers
Nautilus Maintainers
Depends on:
Blocks: 160959
 
 
Reported: 2004-03-28 21:38 UTC by Rob Melby
Modified: 2005-05-08 20:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Rob Melby 2004-03-28 21:38:43 UTC
Description of Problem:


Steps to reproduce the problem:
1. open nautilus
2. click on foo.mp3
3. nautilus dialogue says : "No action associated"
4. click on associate application button 
5. Add file type for "application/x-mp3", program
to run /usr/bin/xmms, hit ok
6. click on foo.mp3 again
7. nautilus dialogue says : "No action associated"
8. click on associate application button
5. add file type...default action is already "X
multimedia System

Actual Results:
   [ as above ]

Expected Results:
  should start xmms

How often does this happen? 
  always

Additional Information:
  under gnome-2.6
Comment 1 Alexander Larsson 2004-03-29 06:29:20 UTC
This is because gnome-vfs adds an old-style new mimetype for the new mimetype
(and, its using the wrong name for the new mimetype, it should be
application/x-ext-mp3), and mimetypes are read with the new mimetype system in 2.6.

I'm pretty sure this is a dup, but i can't find the other bug :/
Comment 2 Alexander Larsson 2004-03-29 06:31:53 UTC
(Of course, the reporters problem is likely a missinstalled shared-mime-info or
something like that, because the mp3 should already have been detected.)
Comment 3 Alexander Larsson 2004-03-30 13:07:01 UTC
I can't find the other bug, so lets consider this one the primary one. 
This is a pretty bad bug that needs to be fixed, but i'm not sure how to do it.
Does the freedesktop.org system allow you to add per-user mimetypes, and does
our implementation read it? If so, where do we put such files, and how do we
launch update-mime-database to update the user part of the database only?
Comment 4 Christophe Fergeau 2004-03-30 13:37:27 UTC
I think there's something in the mime spec saying the user isn't really meant to
edit the mime db. It's possible to add new mime types in a user home dir still
if you want to install programs using the mime db or installing new mimetypes on
a system where you don't have root
Those mime types go to ~/.local/share/mime/
To install a new mime type there, one puts an appropriate xml file in 
~/.local/share/mime/packages/ and run update-mime-db ~/.local/share/mime/ 

xdgmime.c returns two occurrences of ".local", so I guess there's some code in
there which tries to read those, I'm not sure it has been tested though.
Comment 5 Alexander Larsson 2004-03-30 14:12:23 UTC
Well, if we want to associate a file of unknown type to an app, the idea is to
create a new mimetype application/x-ext-<extension> so that we can add the
appropriate mapping in the mime -> application database. This means we need to
be able to add new mimetypes in the user dir. Sounds like its possible...
Comment 6 W. Michael Petullo 2004-05-04 00:13:35 UTC
This is similar to bug #71094 (see especially bug #71094 comment 6), which was
recently closed.  I think gnome-vfs should use the new XDG stuff and drop
gnome-mime-data.  There is currently a lot of redundancies in the databases that
make up the MIME system of a GNOME desktop.  Here are some notes that I have
taken that may help sort things out:

TRADITIONAL GNOME
=================
/etc/gnome-vfs-mime-magic, a magic to MIME mapping
--------------------------------------------------
- no longer used by gnome-vfs?
- provided by gnome-mime-data anyway

/usr/share/mime-info/*.mime, a glob to MIME mapping
---------------------------------------------------

/usr/share/mime-info/*.keys
---------------------------
- provides a list of applications available to open when a file is right clicked
- defines how to open, view and edit

/usr/share/application-registry/*.applications
- can specify MIME types an app. can open (Open with Application...)
- human description of application
- supported URI types
- declares whether an application requires a terminal

FREEDESKTOP.ORG
===============
/usr/share/mime/magic, a magic to MIME mapping
----------------------------------------------

/usr/share/mime/globs, a glob to MIME mapping
---------------------------------------------

/usr/share/applications
-----------------------

/usr/share/mime/audio/x-mpeg.xml
--------------------------------
- human description of MIME type
- can specify applications that can open the MIME type

FILE/COMMAND LINE
=================
/usr/share/file/magic (and magic.mime), a magic to MIME mapping
---------------------------------------------------------------
Comment 7 Axel Buttchereit 2004-08-01 19:05:43 UTC
Yes, MIME is a mess at the moment!

See some of my experiences, comments and solutions (if you like):
  http://forums.gentoo.org/viewtopic.php?p=1397590
  http://bugs.gentoo.org/show_bug.cgi?id=45173  
  http://bugzilla.mozilla.org/show_bug.cgi?id=249153

Somebody should update the Gnome-Desktop Documentation
or - even better - write a Gentoo-Gnome-Mime-HOWTO...
... and a Gentoo-X.org-Xft-fontconfig-pango-HOWTO. :-)

Making mime-types and fonts work the way they should,
took my many, many hours and I am still not sure,
whether I have fully understood this "kind of magic".

I would be happy to contribute my experiences to those
HOWTOs or even write it by myself, if supported by the
Gentoo- and/or Gnome-Team.

Axel

--
Nothing is particularly hard if devided into small pieces.
: Henry Ford

Comment 8 W. Michael Petullo 2004-09-16 20:19:03 UTC
Is this bug fixed by the new MIME system?
Comment 9 Christian Neumair 2005-05-08 20:41:42 UTC
According to [1], recent XMMS versions ship with a sane amount of MimeType
values in its .desktop file and therefore should be fired up flawlessly when
double-clicking MP3 files.

[1] http://cvs.xmms.org/cvsweb.cgi/xmms/xmms/xmms.desktop