[libdazzle] list-store-adapter: fetch the column type
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] list-store-adapter: fetch the column type
- Date: Fri, 18 Aug 2017 07:44:53 +0000 (UTC)
commit 79bb4a26728784f5d6ab23f84ab1b1696bcabb76
Author: Christian Hergert <chergert redhat com>
Date: Fri Aug 18 00:44:44 2017 -0700
list-store-adapter: fetch the column type
use GObject if we don't know what it is (so it stays compatible).
src/tree/dzl-list-store-adapter.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/tree/dzl-list-store-adapter.c b/src/tree/dzl-list-store-adapter.c
index 93b9ab5..50128cf 100644
--- a/src/tree/dzl-list-store-adapter.c
+++ b/src/tree/dzl-list-store-adapter.c
@@ -55,6 +55,19 @@ dzl_list_store_adapter_get_n_columns (GtkTreeModel *model)
return 1;
}
+static GType
+dzl_list_store_adapter_get_column_type (GtkTreeModel *model,
+ gint column)
+{
+ DzlListStoreAdapter *self = DZL_LIST_STORE_ADAPTER (model);
+ DzlListStoreAdapterPrivate *priv = dzl_list_store_adapter_get_instance_private (self);
+
+ if (column == 0)
+ return priv->type;
+
+ return G_TYPE_INVALID;
+}
+
static gboolean
dzl_list_store_adapter_get_iter (GtkTreeModel *model,
GtkTreeIter *iter,
@@ -191,6 +204,7 @@ tree_model_iface_init (GtkTreeModelIface *iface)
{
iface->get_flags = dzl_list_store_adapter_get_flags;
iface->get_n_columns = dzl_list_store_adapter_get_n_columns;
+ iface->get_column_type = dzl_list_store_adapter_get_column_type;
iface->get_iter = dzl_list_store_adapter_get_iter;
iface->get_path = dzl_list_store_adapter_get_path;
iface->get_value = dzl_list_store_adapter_get_value;
@@ -262,7 +276,7 @@ dzl_list_store_adapter_unbind (DzlListStoreAdapter *self,
priv->model = NULL;
priv->length = 0;
- priv->type = G_TYPE_INVALID;
+ priv->type = G_TYPE_OBJECT;
}
static void
@@ -338,6 +352,7 @@ dzl_list_store_adapter_init (DzlListStoreAdapter *self)
{
DzlListStoreAdapterPrivate *priv = dzl_list_store_adapter_get_instance_private (self);
+ priv->type = G_TYPE_OBJECT;
priv->signals = dzl_signal_group_new (G_TYPE_LIST_MODEL);
dzl_signal_group_connect_swapped (priv->signals,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]