Browse Source

Use first valid category listed in Desktop Entry

pull/9/head
roarde 8 years ago
parent
commit
0f6b825298
  1. 45
      src/xdgmenumaker

45
src/xdgmenumaker

@ -347,32 +347,25 @@ def remove_command_keys(command, desktopfile, icon):
def clean_up_categories(categories):
# cleaning up categories and keeping only registered freedesktop.org main
# categories
if 'AudioVideo' in categories:
category = multimedia
elif 'Audio' in categories:
category = multimedia
elif 'Video' in categories:
category = multimedia
elif 'Development' in categories:
category = development
elif 'Education' in categories:
category = education
elif 'Game' in categories:
category = games
elif 'Graphics' in categories:
category = graphics
elif 'Network' in categories:
category = network
elif 'Office' in categories:
category = office
elif 'System' in categories:
category = system
elif 'Settings' in categories:
category = settings
elif 'Utility' in categories:
category = accessories
else:
category = other
category_menus = {
"AudioVideo": multimedia,
"Audio": multimedia,
"Video": multimedia,
"Development": development,
"Education": education,
"Game": games,
"Graphics": graphics,
"Network": network,
"Office": office,
"System": system,
"Settings": settings,
"Utility": accessories
}
category = other
for candidate in categories:
if category_menus.has_key(candidate):
category = category_menus.get(candidate)
break
return category
def get_entry_info(desktopfile, ico_paths=True):

Loading…
Cancel
Save