diff options
author | William Jon McCann <jmccann@redhat.com> | 2012-08-10 13:23:20 -0400 |
---|---|---|
committer | William Jon McCann <jmccann@redhat.com> | 2012-08-20 13:59:09 -0400 |
commit | c5c46a125e6a017a21fed434382d7712398802bc (patch) | |
tree | 42617e88c392dc42a9d777f55e8b84622cdc4888 /gtk/gtkiconview.c | |
parent | a28e1a22a6356bc372bbc8486f2762e6c9b6caa4 (diff) | |
download | gtk+-c5c46a125e6a017a21fed434382d7712398802bc.tar.gz |
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
Diffstat (limited to 'gtk/gtkiconview.c')
-rw-r--r-- | gtk/gtkiconview.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 3da42aecaa..8740f46836 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -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)); } |