Content types

David Zeuthen david at fubar.dk
Thu Jul 3 12:09:51 PDT 2008


On Thu, 2008-07-03 at 20:06 +0200, David Faure wrote:
> * will this create files like /usr/share/mime/x-content/image-dcf.xml, i.e. a "mimetype"
> definition like for every other mimetype?
> That would be fine; otherwise the MimeType field would be pointing to things
> that are not known as mimetypes, and that triggers warnings :)

Yeah, such files will exist.

> * this means a tree could have two or three mimetypes, i.e. inode/directory
> plus x-content/audio-player plus x-content/video-player? What do you do when
> clicking on it, i.e. how do you choose between a directory viewer, an app
> associated with audio-player and an app assocaited with video-player?
> I guess the solution is along the lines of "when the tree/medium has more
> than one 'mimetype', ask the user"?

Yup. We don't handle that very well in GNOME 2.22; the user will get
either multiple programs started or multiple dialogs (depending on
preferences; this

 http://people.freedesktop.org/~david/nautilus-utopia-5.png

is what we currently do. Selecting of preferred applications is handled
just like selecting preferred applications for mime types) like this

 http://people.freedesktop.org/~david/nautilus-utopia-4.png

and also multiple cluebars like this

 http://people.freedesktop.org/~david/nautilus-cluebar-musicplayer.png

All this is fixable though.

> Generally I'm expecting problems due to the paradigm shift from
> "a file/directory has ONE mimetype" to "a directory or medium can have
> more than one mimetype". But I suspect that's fixed by having one mimetype
> and optionally N content-types....
> In fact, do I understand correctly that "medium" is like /dev/sdb1 and "tree" 
> is the directory where /dev/sdb1 is mounted? - and that both would have
> the same content types? (seems fine, just want to make sure I understand this).

Right. In GNOME, for all mounted devices we do all the tests on the
mount point of the device (e.g. the tree) to determine the set of
content types for that mount. Our plan is to make this available on the
GMount class in GVfs (right now it's all in the file manager) so
applications can take advantage of this extra knowledge. For example,
the import dialog of a photo management application might only want to
list (in addition to selecting a directory of course) the set of mounts
that has type x-content/image-dcf. Ditto for video and music management
and other applications.

> No objections from me, just some thoughts :-)

Cool. Thanks for your feedback.

Cheers,
David



More information about the xdg mailing list