[glade] Fixed cellrenderer model column combobox chooser. If treeview model is a filter or a sort model we n
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Fixed cellrenderer model column combobox chooser. If treeview model is a filter or a sort model we n
- Date: Mon, 25 Nov 2013 19:42:19 +0000 (UTC)
commit 4a1ce15232d6e0b2d34e9cc4e817351885426a26
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Sun Nov 24 19:53:17 2013 -0300
Fixed cellrenderer model column combobox chooser.
If treeview model is a filter or a sort model we need to walk up until
we find a tree or list store which is where glade have defined the model columns.
plugins/gtk+/glade-cell-renderer-editor.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/plugins/gtk+/glade-cell-renderer-editor.c b/plugins/gtk+/glade-cell-renderer-editor.c
index 3286ef9..67d48b4 100644
--- a/plugins/gtk+/glade-cell-renderer-editor.c
+++ b/plugins/gtk+/glade-cell-renderer-editor.c
@@ -423,7 +423,8 @@ GLADE_MAKE_EPROP (GladeEPropCellAttribute, glade_eprop_cell_attribute)
#define GLADE_IS_EPROP_CELL_ATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GLADE_TYPE_EPROP_CELL_ATTRIBUTE))
#define GLADE_IS_EPROP_CELL_ATTRIBUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GLADE_TYPE_EPROP_CELL_ATTRIBUTE))
#define GLADE_EPROP_CELL_ATTRIBUTE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o),
GLADE_EPROP_CELL_ATTRIBUTE, GladeEPropCellAttributeClass))
- static void glade_eprop_cell_attribute_finalize (GObject * object)
+static void
+glade_eprop_cell_attribute_finalize (GObject *object)
{
/* Chain up */
GObjectClass *parent_class =
@@ -436,12 +437,22 @@ GLADE_MAKE_EPROP (GladeEPropCellAttribute, glade_eprop_cell_attribute)
static GladeWidget *
glade_cell_renderer_parent_get_model (GladeWidget *widget)
{
- GtkTreeModel *real_model = NULL;
-
- glade_widget_property_get (widget, "model", &real_model);
+ GtkTreeModel *model = NULL;
- if (real_model)
- return glade_widget_get_from_gobject (real_model);
+ glade_widget_property_get (widget, "model", &model);
+
+ do
+ {
+ if (GTK_IS_TREE_MODEL_SORT (model))
+ model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model));
+ else if (GTK_IS_TREE_MODEL_FILTER (model))
+ model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
+ else
+ break;
+ } while (model);
+
+ if (model)
+ return glade_widget_get_from_gobject (model);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]