Codebase list cinnamon-menus / d63a35f
Fix handling of malformed desktop files (#40) This fixes handling of malformed desktop files that do not contain an exec line Cobinja authored 3 years ago GitHub committed 3 years ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3535 static void
3636 update_app_data (GMenuDesktopAppInfo *info)
3737 {
38 const gchar *exec;
39 const gchar *id;
40 const gchar *startup_wm_class;
38 gchar *exec = NULL;
39 gchar *id = NULL;
40 gchar *startup_wm_class = NULL;
4141
4242 g_free (info->desktop_id);
4343 info->desktop_id = NULL;
5050
5151 if (info->super_appinfo != NULL)
5252 {
53 exec = g_app_info_get_executable (G_APP_INFO (info->super_appinfo));
54 id = g_app_info_get_id (G_APP_INFO (info->super_appinfo));
55 startup_wm_class = g_desktop_app_info_get_startup_wm_class (info->super_appinfo);
56
57 if (strstr (exec, "flatpak") || strstr (exec, "bwrap"))
53 exec = (gchar *) g_app_info_get_executable (G_APP_INFO (info->super_appinfo));
54 id = (gchar *) g_app_info_get_id (G_APP_INFO (info->super_appinfo));
55 startup_wm_class = (gchar *) g_desktop_app_info_get_startup_wm_class (info->super_appinfo);
56
57 if (exec && (strstr (exec, "flatpak") || strstr (exec, "bwrap")))
5858 {
5959 info->desktop_id = g_strconcat (id, GMENU_DESKTOPAPPINFO_FLATPAK_SUFFIX, NULL);
6060 if (startup_wm_class)