diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-07-08 21:06:58 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-07-11 00:15:42 -0500 |
commit | 201d4c110186dcfa77f2cee2bed88f1674c52f54 (patch) | |
tree | dd7503ac06968bb4745ceac56634607599eee132 | |
parent | 72a8064c7d1ebf3bffb20b0f4c3092d7ae4fb1cf (diff) | |
download | gtk+-201d4c110186dcfa77f2cee2bed88f1674c52f54.tar.gz |
file chooser: Avoid doing excess work
Whenever we change directories, we unset the model, and then
we set a new model. This causes several emissions of
GtkTreeSelection::changed, for each of which we do a bunch
of work to update the path bar, the location entry, etc.
We can savely ignore some of these signals, and do less work.
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index a09f0a50c2..6caae6c005 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -7584,6 +7584,9 @@ list_selection_changed (GtkTreeSelection *selection, { GtkFileChooserWidgetPrivate *priv = impl->priv; + if (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->browse_files_tree_view)) == NULL) + return; + /* See if we are in the new folder editable row for Save mode */ if (priv->operation_mode == OPERATION_MODE_BROWSE && priv->action == GTK_FILE_CHOOSER_ACTION_SAVE) |