[libgd] list-view: Don't clear attributes on no model
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] list-view: Don't clear attributes on no model
- Date: Fri, 25 Oct 2013 19:00:52 +0000 (UTC)
commit 41820ae96142312ffc0109b65d2adad6f007e1fd
Author: Pierre-Yves Luyten <py luyten fr>
Date: Tue Oct 22 21:33:07 2013 +0200
list-view: Don't clear attributes on no model
No point in clearing the existing attributes in set_attributes_from_model
if we are not going to actually set any
libgd/gd-main-list-view.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libgd/gd-main-list-view.c b/libgd/gd-main-list-view.c
index c3a2156..68e4cdf 100644
--- a/libgd/gd-main-list-view.c
+++ b/libgd/gd-main-list-view.c
@@ -61,12 +61,14 @@ set_attributes_from_model (GdMainListView *self)
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
GType icon_gtype;
+
+ if (!model)
+ return;
+
gtk_tree_view_column_clear_attributes (self->priv->tree_col, self->priv->pixbuf_cell);
gtk_tree_view_column_clear_attributes (self->priv->tree_col, self->priv->selection_cell);
gtk_tree_view_column_clear_attributes (self->priv->tree_col, self->priv->text_cell);
- if (!model)
- return;
gtk_tree_view_column_add_attribute (self->priv->tree_col, self->priv->selection_cell,
"active", GD_MAIN_COLUMN_SELECTED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]