Bug 25702 - extra groups in desktop files are not handled properly
Summary: extra groups in desktop files are not handled properly
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: menu (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Sergey V Turchin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-01 21:02 MSK by Sergey Vlasov
Modified: 2011-06-03 21:21 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vlasov 2011-06-01 21:02:41 MSK
menu-2.1.41-alt19

В deadbeef-0.5.1-alt1 в файле /usr/share/applications/deadbeef.desktop, помимо стандартной группы [Desktop Entry], появились дополнительные группы:

===============================================================
[Play Shortcut Group]
Name=Play
Exec=deadbeef --play
TargetEnvironment=Unity

[Pause Shortcut Group]
Name=Pause
Exec=deadbeef --pause
TargetEnvironment=Unity

[Stop Shortcut Group]
Name=Stop
Exec=deadbeef --stop
TargetEnvironment=Unity

[Next Shortcut Group]
Name=Next
Exec=deadbeef --next
TargetEnvironment=Unity

[Prev Shortcut Group]
Name=Prev
Exec=deadbeef --prev
TargetEnvironment=Unity
===============================================================

Однако update-menus обрабатывает этот файл неправильно - вместо того, чтобы брать значения Name и Exec из группы [Desktop Entry], берутся последние встреченные строки в файле без учёта группы, в результате в меню вместо пункта "DeaDBeeF" появляется "Prev", запускающий "deadbeef --prev".

Спецификация формата desktop-файлов допускает наличие дополнительных групп после [Desktop Entry]:

The basic format of the desktop entry file requires that there be a group header named Desktop Entry. There may be other groups present in the file, but this is the most important group which explicitly needs to be supported. This group should also be used as the "magic key" for automatic MIME type detection. There should be nothing preceding this group in the desktop entry file but possibly one or more comments.

Т.е., в desktop-файле могут быть любые группы, необходимо лишь, чтобы группа [Desktop Entry] была размещена в начале файла.
Comment 1 Repository Robot 2011-06-01 22:23:15 MSK
menu-2.1.41-alt20 -> sisyphus:

* Wed Jun 01 2011 Igor Vlasenko <viy@altlinux> 2.1.41-alt20
- bugfix: handle extra groups in desktop files (ALT#25702)