Commit c5c46a12 authored by William Jon McCann's avatar William Jon McCann

icon-view: emit selection-changed when changing the model

Only if there was a selection active.

https://bugzilla.gnome.org/show_bug.cgi?id=681613
parent a28e1a22
......@@ -4901,6 +4901,8 @@ void
gtk_icon_view_set_model (GtkIconView *icon_view,
GtkTreeModel *model)
{
gboolean dirty;
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
......@@ -4917,6 +4919,8 @@ gtk_icon_view_set_model (GtkIconView *icon_view,
if (icon_view->priv->cell_area)
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
dirty = gtk_icon_view_unselect_all_internal (icon_view);
if (model)
{
GType column_type;
......@@ -5001,6 +5005,9 @@ gtk_icon_view_set_model (GtkIconView *icon_view,
g_object_notify (G_OBJECT (icon_view), "model");
if (dirty)
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
}
......
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