[Gpephone-devel] 答复: MIME actions (was: Re: Adding new entry to.desktop file)

WANG Gang RD-ILAB-PEK gang.wang at orange-ftgroup.com
Mon Jan 14 10:12:32 CET 2008


Hi,

  I would go for solution 2 with some slight modifications:

[Desktop Entry]
Version=1.0
Type=Application
Encoding=UTF-8
Name=Foo Viewer
Comment=The best viewer for Foo objects available!
TryExec=fooview
Exec=fooview %F
Icon=fooview.png
MimeType=image/x-foo
X-KDE-Library=libfooview
X-KDE-FactoryName=fooviewfactory
X-KDE-ServiceType=FooService
Actions=Inverse;Edit;

[Desktop Action 1]
MimeType=image/x-foo
Action=Inverse

[Desktop Action 2]
MimeType=image/x-foo
Action=Edit

...

  Apart from the main section [Desktop Entry], the other sections are for each mimetype/action pair's information purpose. Since these sections are used to separate different mimetype/action pairs, their names don't matter much.
  I have added some code to gpe-applauncher, by using 'gnome_desktop_file_foreach_section', it's quiet easy to retrieve information of different mimetype/action pairs while the .desktop file looks neat and well organized.
  For this time being, the [Desktop Action X] sections need only MimeType and Action entries.

  If there are no any other different opinions, I will carry out implementation based on this hypothesis of .desktop file organization.


> -----邮件原件-----
> 发件人: gpephone-devel-bounces at linuxtogo.org
> [mailto:gpephone-devel-bounces at linuxtogo.org] 代表 Florian Boor
> 发送时间: 2008年1月8日 23:43
> 收件人: Gpephone devel
> 主题: [Gpephone-devel] MIME actions (was: Re: Adding new entry
> to.desktop file)
>
> Hi!
>
> Nils Faerber schrieb:
> > So if there is the urgent need to have something *now* then I would
> > agree with it. Realistically it will take several days (if
> not weeks)
> > to get some conclusive answer.
>
> If that's the case we just add this new entry to the desktop
> files. If we like to change to another solution we can do
> that later on easily - its just a matter of where the
> applications get this information from.
> This also means that we need to write a short specification
> about syntax and semantics of the new data field. Especially
> the list of valid actions needs to be specified and it needs
> to be defined what these mean. e.g. "open" would be ambiguous
> because it could mean "display", "edit"...
>
> I have some more information about the other options and the
> current status of
> specifications:
>
> The fdo MIME database is widely used and several applications
> install override files (usually in
> /usr/share/mime/packages/). These are usually used to add
> custom MIME types specific for the applications. The MIME
> Actions as proposed in [1] are usually not used. That is
> mostly because of a lacking specification for valid actions.
> If we decide to go into this direction at some point we will
> have the opportunity to help finishing the specification.
> The major advantage of this solution is that is very
> flexible. The disadvantages are that we get quite some
> overhead at the application startup and most likely we need
> to introduce a cache for the parsed data.
>
> Another solution would be the the the "Desktop Actions" which
> are an extension to define possible actions in desktop files.
> An example can be found here [2].
> Currently these are not part of the Desktop file
> specification because they were removed in order to finish
> the 1.0 revision of the standards. Obviously they are used
> already (e.g. in XFCE) and are going to appear again in near future.
> The major advantage of these is that they are extremely
> flexible (we can specify a command syntax for each action)
> and we do not need an extra parser because the syntax is more
> or less what we have in common desktop files.
>
> [1] http://www.freedesktop.org/wiki/Specifications/mime-actions-spec
>
> [2]
> http://lists.freedesktop.org/archives/xdg/2006-February/006102.html
>
>
> Greetings
>
> Florian
>
> --
> The dream of yesterday                  Florian Boor
> is the hope of today                    Tel: +49 271-771091-15
> and the reality of tomorrow.            Fax: +49 271-771091-19
> [Robert Hutchings Goddard, 1904]        florian.boor at kernelconcepts.de
>
> 1D78 2D4D 6C53 1CA4 5588  D07B A8E7 940C 25B7 9A76
>
> _______________________________________________
> Gpephone-devel mailing list
> Gpephone-devel at linuxtogo.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/gpephone-devel
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linuxtogo.org/pipermail/gpephone-devel/attachments/20080114/e6dfc928/attachment.html 


More information about the Gpephone-devel mailing list