Commit 7cf1d122 authored by William Jon McCann's avatar William Jon McCann

Don't show apps that don't support files or uris

https://bugzilla.gnome.org/show_bug.cgi?id=682729
parent 51da82e9
......@@ -258,16 +258,22 @@ filter_nautilus_handler (GList *apps)
}
static GList*
filter_non_uri_apps (GList *apps)
filter_non_uri_apps (GList *apps,
gboolean accept_files)
{
GList *l, *next;
GAppInfo *app;
for (l = apps; l != NULL; l = next) {
gboolean support;
app = l->data;
next = l->next;
if (!g_app_info_supports_uris (app)) {
support = g_app_info_supports_uris (app);
if (accept_files) {
support |= g_app_info_supports_files (app);
}
if (!support) {
apps = g_list_delete_link (apps, l);
g_object_unref (app);
}
......@@ -275,7 +281,6 @@ filter_non_uri_apps (GList *apps)
return apps;
}
static gboolean
nautilus_mime_actions_check_if_required_attributes_ready (NautilusFile *file)
{
......@@ -442,12 +447,10 @@ nautilus_mime_get_applications_for_file (NautilusFile *file)
}
g_free (uri_scheme);
}
if (!file_has_local_path (file)) {
/* Filter out non-uri supporting apps */
result = filter_non_uri_apps (result);
}
/* Filter out non-uri supporting apps */
result = filter_non_uri_apps (result, file_has_local_path (file));
result = g_list_sort (result, (GCompareFunc) application_compare_by_name);
g_free (mime_type);
......
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