[Gpephone-devel] Adding new entry to .desktop file

Nils Faerber nils.faerber at kernelconcepts.de
Thu Jan 3 13:15:19 CET 2008


Browsing a little deeper it seems that there is already a solution or
standard for the verb/mimetype specification:

http://www.freedesktop.org/wiki/Specifications/AddingMIMETutor

For me this translates as, the desktop file will contain all mimetype an
application can handle. Then there is the mimetype database where
applications can add the "verbs", i.e. actions. The tutorial (above)
shows an example for Gimp:
	<desktop:can-edit-with>gimp.desktop</desktop:can-edit-with>

It is not clear to me yet where this information will end and how to use
it. But it seems to me the correct start of the track - if there is
already a standard wayof doing it, we should try to use it.

Cheers
  nils

Nils Faerber schrieb:
> WANG Gang RD-ILAB-PEK schrieb:
>> Hi, Florian
> Hello!
> 
> Conincidentially we had this discussion yersterday ;)
> 
>>     Based on our last meeting in Beijing, some new information of an
>> application is to be added to its .desktop file to manifest its
>> capabilities of acting upon certain types of data.
>>     I am thinking of doing this as following:
>>
>>     Mime=audio/mp3:Open;application/ogg:Edit
> 
> There is already a mimetype entry for the already used .desktop files, see
> 
> http://standards.freedesktop.org/desktop-entry-spec/latest/
> 
> and especially
> 
> http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
> 
>>     the key is 'Mime'
>>     diferrent mime types and actions are delimited by a semi colon ';'
>>     each mime type is followed by a colon ':' which introduces the
>> action(s)
>>     for the same mime type, if this application is capable of achieving
>> more than one action, separate them by a comma ',', for example:
>> audio/mp3:Open,Edit
>>     mime types are based on iana's specification, but we are not limited
>> in this domain, we can freely add any mime types if appropriate.
> 
> The "problem" here is how to add the verbs.
> The MimeType field already allows for a list of mimetypes.
> The second problem is that we have to standardise verbs we want to
> become common methods (like "open" vs. "read" - only one should be used).
> 
>>     When applauncher parses the .desktop file, it will store the
>> information in a hash table by using each mime/action pair (in form of
>> 'mime:action') as the key and application's name as the value.
> 
> That looks good ;)
> 
> On the one hand it seems to be a bad idea to duplicate the already
> existing MimeType field on the other hand its current content is too
> limiting for us.
> Probably we should ask the .desktop standard creators for advise? I
> could imagine to create a new tag for our purpose, like
> 	MimeTypeAction
> or similar.
> What I would like to see is
> - allow multiple occurance of the keyword/label
> - have one mimetype and multiple verbs per entry
> 
> Like:
> ...
> MimeTypeAction=text/ascii:create,open,read,save
> MimeTypeAction=image/jpeg:open
> ...
> 
> This would be easy to parse and easy to read.
> 
>>     What is your idea?
> 
> Good start!
> 
>> BR
>> Gang
> Cheers
>   nils faerber
> 


Viele Grüße
  nils faerber

-- 
kernel concepts GbR        Tel: +49-271-771091-12
Sieghuetter Hauptweg 48    Fax: +49-271-771091-19
D-57072 Siegen             Mob: +49-176-21024535
--



More information about the Gpephone-devel mailing list