Commit 7770b63d authored by Cosimo Cecchi's avatar Cosimo Cecchi

mime-actions: filter applications not supposed to be visible

Ensure NoDisplay=True applications don't end up in our Open With context
menus.

https://bugzilla.gnome.org/show_bug.cgi?id=696372
parent 0e256a36
......@@ -257,6 +257,28 @@ filter_nautilus_handler (GList *apps)
return apps;
}
static GList*
filter_no_show_apps (GList *apps)
{
GList *l, *next;
GAppInfo *application;
l = apps;
while (l != NULL) {
application = (GAppInfo *) l->data;
next = l->next;
if (!g_app_info_should_show (application)) {
g_object_unref (application);
apps = g_list_delete_link (apps, l);
}
l = next;
}
return apps;
}
static GList*
filter_non_uri_apps (GList *apps,
gboolean accept_files)
......@@ -448,6 +470,8 @@ nautilus_mime_get_applications_for_file (NautilusFile *file)
g_free (uri_scheme);
}
result = filter_no_show_apps (result);
/* Filter out non-uri supporting apps */
result = filter_non_uri_apps (result, file_has_local_path (file));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment