Only list applications that can be ran

This commit is contained in:
Pierre Pronchery 2020-09-28 03:52:00 +02:00
parent 8b2f86384a
commit f8c36879dd

View File

@ -244,15 +244,17 @@ static void _applications_on_refresh_loop_path(DesktopHandler * handler,
fprintf(stderr, "DEBUG: %s() name=\"%s\" path=\"%s\"\n",
__func__, name, path);
#endif
if((mime = mimehandler_new_load(name)) == NULL
|| mimehandler_can_display(mime) == 0)
if((mime = mimehandler_new_load(name)) == NULL)
{
if(mime != NULL)
mimehandler_delete(mime);
else
desktop_serror(NULL, NULL, 1);
continue;
}
if(mimehandler_can_display(mime) == 0
|| mimehandler_can_execute(handler) == 0)
{
mimehandler_delete(mime);
continue;
}
handler->u.applications.apps = g_slist_insert_sorted(
handler->u.applications.apps, mime,
_applications_apps_compare);