Skip to content

Commit 763faf1

Browse files
committed
gmenu-tree.c: Return a basename if no appinfo is available when
sorting. This is a workaround: if a desktop file is edited and becomes invalid, the tree rebuilds and re-loading that file initially fails and gets added to our "retry later" list (see b5495c4). The problem is, mimeinfo never updates in this case, and we end up with basically an invalid desktop entry with no appinfo. This is mainly to silence a lot of runtime warnings because the sorting fails.
1 parent 8293c1c commit 763faf1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libmenu/gmenu-tree.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,11 @@ gmenu_tree_item_compare_get_name_helper (GMenuTreeItem *item,
17791779
break;
17801780

17811781
case GMENU_TREE_ITEM_ENTRY:
1782+
if (gmenu_tree_entry_get_app_info (GMENU_TREE_ENTRY (item)) == NULL)
1783+
{
1784+
return desktop_entry_get_basename (GMENU_TREE_ENTRY (item)->desktop_entry);
1785+
}
1786+
17821787
if (flags & GMENU_TREE_FLAGS_SORT_DISPLAY_NAME)
17831788
name = g_app_info_get_display_name (G_APP_INFO (gmenu_tree_entry_get_app_info (GMENU_TREE_ENTRY (item))));
17841789
else

0 commit comments

Comments
 (0)