[Xfce4-commits] <thunar:master> Also check visible for applications in chooser button.

Nick Schermer noreply at xfce.org
Tue Sep 25 20:16:01 CEST 2012


Updating branch refs/heads/master
         to a466d0668d9696d206f37c89a28d1ff5d7e6eebb (commit)
       from 159346a32e6d014267f45daed2ba7491f7b95838 (commit)

commit a466d0668d9696d206f37c89a28d1ff5d7e6eebb
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Sep 25 20:12:31 2012 +0200

    Also check visible for applications in chooser button.

 thunar/thunar-chooser-button.c |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/thunar/thunar-chooser-button.c b/thunar/thunar-chooser-button.c
index fb9489a..fa2cf8b 100644
--- a/thunar/thunar-chooser-button.c
+++ b/thunar/thunar-chooser-button.c
@@ -453,21 +453,25 @@ thunar_chooser_button_file_changed (ThunarChooserButton *chooser_button,
           /* add all possible applications */
           for (lp = app_infos, i = 0; lp != NULL; lp = lp->next, ++i)
             {
-              /* insert the item into the store */
-              gtk_list_store_insert_with_values (chooser_button->store, &iter, i,
-                                                 THUNAR_CHOOSER_BUTTON_STORE_COLUMN_NAME,
-                                                 g_app_info_get_name (lp->data),
-                                                 THUNAR_CHOOSER_BUTTON_STORE_COLUMN_APPLICATION,
-                                                 lp->data,
-                                                 THUNAR_CHOOSER_BUTTON_STORE_COLUMN_ICON,
-                                                 g_app_info_get_icon (lp->data),
-                                                 THUNAR_CHOOSER_BUTTON_STORE_COLUMN_SENSITIVE,
-                                                 TRUE,
-                                                 -1);
-
-              /* pre-select the default application */
-              if (g_app_info_equal (lp->data, app_info))
-                gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser_button), &iter);
+              /* skip infos that have NoDisplay or OnlyShowIn set */
+              if (g_app_info_should_show (lp->data))
+                {
+                  /* insert the item into the store */
+                  gtk_list_store_insert_with_values (chooser_button->store, &iter, i,
+                                                     THUNAR_CHOOSER_BUTTON_STORE_COLUMN_NAME,
+                                                     g_app_info_get_name (lp->data),
+                                                     THUNAR_CHOOSER_BUTTON_STORE_COLUMN_APPLICATION,
+                                                     lp->data,
+                                                     THUNAR_CHOOSER_BUTTON_STORE_COLUMN_ICON,
+                                                     g_app_info_get_icon (lp->data),
+                                                     THUNAR_CHOOSER_BUTTON_STORE_COLUMN_SENSITIVE,
+                                                     TRUE,
+                                                     -1);
+                  
+                  /* pre-select the default application */
+                  if (g_app_info_equal (lp->data, app_info))
+                    gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser_button), &iter);
+                }
 
               /* release the application */
               g_object_unref (lp->data);


More information about the Xfce4-commits mailing list