[nautilus] mime-actions: filter applications not supposed to be visible



commit 7770b63d6726bc7ab4b886d6bd3edd009e622e55
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Mar 22 12:43:20 2013 -0400

    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

 src/nautilus-mime-actions.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index a31047a..2b1c677 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -258,6 +258,28 @@ filter_nautilus_handler (GList *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));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]