From: Matthias Clasen Date: Thu, 9 Jul 2015 01:09:23 +0000 (-0400) Subject: file chooser: Do less work X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~24^2~9088 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=24dc6f877120787fafb01bc6a3dc5b1c914ba21f;p=gtk4.git file chooser: Do less work We only need to update the sensitivity of the context menu items rihgt before we are going to pop it up. Everything else is pointless work. --- diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 6caae6c005..d6fe28144e 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -2239,8 +2239,6 @@ file_list_build_popup_menu (GtkFileChooserWidget *impl) priv->sort_directories_item = file_list_add_check_menu_item (impl, _("Sort _Folders before Files"), G_CALLBACK (sort_directories_toggled_cb)); - - check_file_list_menu_sensitivity (impl); } /* Updates the popup menu for the file list, creating it if necessary */ @@ -2250,6 +2248,7 @@ file_list_update_popup_menu (GtkFileChooserWidget *impl) GtkFileChooserWidgetPrivate *priv = impl->priv; file_list_build_popup_menu (impl); + check_file_list_menu_sensitivity (impl); /* The sensitivity of the Add to Bookmarks item is set in * bookmarks_check_add_sensitivity() @@ -7610,7 +7609,6 @@ list_selection_changed (GtkTreeSelection *selection, location_bar_update (impl); check_preview_change (impl); - check_file_list_menu_sensitivity (impl); g_signal_emit_by_name (impl, "selection-changed", 0); }