Re: mime types and gnome




>Multiple ext and regex entries can be provided for this mime-type.
>Please note that the regex keyword only allows one regular expression
>per line, while the ext keyword lets you list a number of extensions
>in the same line.

There was a suggestion a few months ago that Gnome should use a
combination of magic numbers and extensions to identify file types. Is this
going to be implemented?

>4. Default keys
>---------------
>
>The following keys are recognized in the GNOME desktop:
>
>    key			action
>------------------------------------------------------------
>
>    open		open the give file with this command.
>
>    icon-filename	points to a filename with the icon
>			that should be used to represent files 
>			of this type
>
>    view                Command to view the file contents.
>
>    ascii-view          A command that should be used to do
>			an ascii-rendering of the file.   Used as 
>			a fall-back by the filemanager if a "view"
>			action does not exist.
>
>    fm-open             file-manager open.  If present, the file
>			manager will use this action instead of the
>			value in open to perform this action (the 
>			filemanager for example will open archive files
>			as if they were directories by using the VFS).
>
>    fm-view		file-manager view.  If present, invoking the
>			view operation on the file manager will use the
>			value defined here instead of the value in
>			"view".
>
>    fm-ascii-view	Fall-back operation for the file manager as
>			well.
>
>Those keys are also queried on the metadata (except in the cases where
>the lookup would be too expensive). 
>
>5. Defining multiple actions
>----------------------------
>
>Sometimes it is important to provide more than one "open" action.  To
>do this, the keys should be specified in the following fashion (The
>same applies to any other key that might need more than one option):
>
>text/plain:
>	open=command %f
>	open.tag1.Do this and that=this-and-that %f
>	open.tag2.Gzip it=gzip %f
>	open.tag3.Mail it=mail %{Recipient} < %f
>
>This will define a default action (which would invoke "command %f"),
>and three extra open commands:
>   
>   "Do this and that"	-> this-and-that %f
>   "Gzip it"		-> gzip %f
>   "Mail it"		-> mail ${Recipient} < %f
>
>Please notice that you have to add a "tag" to every "open" key.

Thanks for the explanation of how Gnome handles MIME types. There are a
couple of things I don't understand:

1) If there is a way of specifying multiple named actions for a MIME type 
(using tags), why do we need "open", "view" and "ascii-view" keys? Surely the
neatest solution would be to implement all user actions as tags on the
"open" key?

2) Why have separate "fm-view" and "fm-ascii-view" keys? I can understand
that the file manager may want to decide its action when a file is
double-clicked according to the MIME type of the file, but why does it need 
to define more than one action?

3) GMC's context menus contain at least "open", "view" and "edit" commands. 
For many file types these duplicate each other, making the menu
unnecessarily cluttered. Wouldn't it be better to list the actions defined by 
the tags on the "open" key, and if no action has been defined, have a link to 
the MIME type capplet (labelled "Open with...")?



Michael Rogers



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