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

Loading…
Cancel
Save