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