[libgda] Fixed make check all tests pass
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Fixed make check all tests pass
- Date: Fri, 5 Apr 2013 19:37:50 +0000 (UTC)
commit 635df0eac9ff072e36f46f5fc224c37b2e033e5d
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Apr 4 18:16:53 2013 -0600
Fixed make check all tests pass
libgda-ui/gdaui-raw-grid.c | 2 +-
libgda-ui/gdaui-set.c | 85 ++++++++++++++----------------
libgda-ui/gdaui-set.h | 4 +-
libgda/gda-set.c | 122 +++++++++++++++++++++++--------------------
libgda/gda-set.h | 5 +-
libgda/libgda-5.0.vapi | 7 ++-
libgda/libgda.symbols | 3 +-
7 files changed, 117 insertions(+), 111 deletions(-)
---
diff --git a/libgda-ui/gdaui-raw-grid.c b/libgda-ui/gdaui-raw-grid.c
index 50d918f..9e1da3f 100644
--- a/libgda-ui/gdaui-raw-grid.c
+++ b/libgda-ui/gdaui-raw-grid.c
@@ -533,7 +533,7 @@ gdaui_raw_grid_set_property (GObject *object,
grid->priv->iter = gda_data_model_create_iter (GDA_DATA_MODEL
(grid->priv->proxy));
grid->priv->iter_row = -1;
- grid->priv->iter_info = _gdaui_set_new (GDA_SET (grid->priv->iter));
+ grid->priv->iter_info = gdaui_set_new (GDA_SET (grid->priv->iter));
g_signal_connect (grid->priv->iter_info, "public-data-changed",
G_CALLBACK (paramlist_public_data_changed_cb), grid);
diff --git a/libgda-ui/gdaui-set.c b/libgda-ui/gdaui-set.c
index 453ee5e..4911064 100644
--- a/libgda-ui/gdaui-set.c
+++ b/libgda-ui/gdaui-set.c
@@ -72,6 +72,7 @@ gdaui_set_group_get_type (void)
/**
* gdaui_set_group_new:
+ * @group: a #GdaSetGroup
*
* Creates a new #GdauiSetGroup struct.
*
@@ -80,11 +81,12 @@ gdaui_set_group_get_type (void)
* Since: 5.2
*/
GdauiSetGroup*
-gdaui_set_group_new (void)
+gdaui_set_group_new (GdaSetGroup *group)
{
+ g_return_val_if_fail (group, NULL);
GdauiSetGroup *sg = g_new0 (GdauiSetGroup, 1);
sg->source = NULL;
- sg->group = NULL;
+ sg->group = group;
return sg;
}
@@ -104,9 +106,8 @@ gdaui_set_group_copy (GdauiSetGroup *sg)
g_return_val_if_fail (sg, NULL);
GdauiSetGroup *n;
- n = gdaui_set_group_new ();
- n->source = sg->source;
- n->group = sg->group;
+ n = gdaui_set_group_new (gdaui_set_group_get_group (sg));
+ gdaui_set_group_set_source (n, gdaui_set_group_get_source (sg));
return n;
}
@@ -128,9 +129,9 @@ gdaui_set_group_free (GdauiSetGroup *sg)
/**
* gdaui_set_group_set_source:
* @sg: a #GdauiSetGroup struct to free
- * @source: a #GdauiSetSource struct
+ * @source (allow-none): a #GdauiSetSource struct or NULL
*
- * Set source to @source.
+ * Set source to @source. if @source is #NULL, then @group nodes contains exactly one entry.
*
* Since: 5.2
*/
@@ -138,7 +139,7 @@ void
gdaui_set_group_set_source (GdauiSetGroup *sg, GdauiSetSource *source)
{
g_return_if_fail (sg);
- sg->source = sg->source;
+ sg->source = source;
}
/**
@@ -171,7 +172,7 @@ void
gdaui_set_group_set_group (GdauiSetGroup *sg, GdaSetGroup *group)
{
g_return_if_fail (sg);
- g_return_if_fail (group);
+ g_warn_if_fail (group);
sg->group = sg->group;
}
@@ -259,10 +260,11 @@ gdaui_set_source_get_type (void)
* Since: 5.2
*/
GdauiSetSource*
-gdaui_set_source_new (void)
+gdaui_set_source_new (GdaSetSource *source)
{
+ g_return_val_if_fail (source, NULL);
GdauiSetSource *s = g_new0 (GdauiSetSource, 1);
- s->source = NULL;
+ s->source = source;
s->shown_n_cols = 0;
s->shown_cols_index = NULL;
s->ref_n_cols = 0;
@@ -285,20 +287,14 @@ GdauiSetSource *
gdaui_set_source_copy (GdauiSetSource *s)
{
GdauiSetSource *n;
- gint i,j;
g_return_val_if_fail (s, NULL);
- n = gdaui_set_source_new ();
- n->source = s->source;
- n->ref_n_cols = s->ref_n_cols;
- n->ref_cols_index = g_new0 (gint,n->ref_n_cols);
- for (i = 0; i < n->ref_n_cols; i++) {
- n->ref_cols_index[i] = s->ref_cols_index[i];
- }
- n->shown_n_cols = s->shown_n_cols;
- n->shown_cols_index = g_new0 (gint, n->shown_n_cols);
- for (j = 0; j < n->shown_n_cols; j++) {
- n->shown_cols_index[j] = s->shown_cols_index[j];
- }
+ n = gdaui_set_source_new (gdaui_set_source_get_source (s));
+ gdaui_set_source_set_ref_columns (n,
+ gdaui_set_source_get_ref_columns (s),
+ gdaui_set_source_get_ref_n_cols (s));
+ gdaui_set_source_set_shown_columns (n,
+ gdaui_set_source_get_shown_columns (s),
+ gdaui_set_source_get_shown_n_cols (s));
return n;
}
@@ -334,6 +330,7 @@ void
gdaui_set_source_set_source (GdauiSetSource *s, GdaSetSource *source)
{
g_return_if_fail (s);
+ g_return_if_fail (source);
s->source = s->source;
}
@@ -741,11 +738,10 @@ compute_public_data (GdauiSet *set)
hash = g_hash_table_new (NULL, NULL);
for (list = aset->sources_list; list; list = list->next) {
GdauiSetSource *dsource;
- dsource = gdaui_set_source_new ();
+ dsource = gdaui_set_source_new (GDA_SET_SOURCE (list->data));
set->sources_list = g_slist_prepend (set->sources_list, dsource);
g_hash_table_insert (hash, list->data, dsource);
- gdaui_set_source_set_source (dsource, GDA_SET_SOURCE (list->data));
compute_shown_columns_index (dsource);
compute_ref_columns_index (dsource);
}
@@ -754,12 +750,12 @@ compute_public_data (GdauiSet *set)
/* scan GdaSetGroup list */
for (list = aset->groups_list; list; list = list->next) {
GdauiSetGroup *dgroup;
- dgroup = gdaui_set_group_new ();
- set->groups_list = g_slist_prepend (set->groups_list, dgroup);
- gdaui_set_group_set_group (dgroup, GDA_SET_GROUP (list->data));
+ g_assert (list->data);
+ dgroup = gdaui_set_group_new (GDA_SET_GROUP (list->data));
gdaui_set_group_set_source (dgroup,
g_hash_table_lookup (hash,
- GDA_SET_GROUP (list->data)->nodes_source));
+ gda_set_group_get_source (GDA_SET_GROUP
(list->data))));
+ set->groups_list = g_slist_prepend (set->groups_list, dgroup);
}
set->groups_list = g_slist_reverse (set->groups_list);
@@ -778,7 +774,7 @@ update_public_data (GdauiSet *set)
shash = g_hash_table_new (NULL, NULL);
for (list = set->sources_list; list; list = list->next) {
GdauiSetSource *dsource = (GdauiSetSource*) list->data;
- g_hash_table_insert (shash, dsource->source, dsource);
+ g_hash_table_insert (shash, gdaui_set_source_get_source (dsource), dsource);
}
/* scan GdaSetSource list */
@@ -791,11 +787,10 @@ update_public_data (GdauiSet *set)
set->sources_list = g_slist_prepend (set->sources_list, dsource);
continue;
}
- dsource = gdaui_set_source_new ();
+ dsource = gdaui_set_source_new (GDA_SET_SOURCE (list->data));
set->sources_list = g_slist_prepend (set->sources_list, dsource);
g_hash_table_insert (shash, list->data, dsource);
- gdaui_set_source_set_source (dsource, GDA_SET_SOURCE (list->data));
compute_shown_columns_index (dsource);
compute_ref_columns_index (dsource);
}
@@ -815,7 +810,7 @@ update_public_data (GdauiSet *set)
ghash = g_hash_table_new (NULL, NULL);
for (list = set->groups_list; list; list = list->next) {
GdauiSetGroup *dgroup = (GdauiSetGroup*) list->data;
- g_hash_table_insert (ghash, dgroup->group, dgroup);
+ g_hash_table_insert (ghash, gdaui_set_group_get_group (dgroup), dgroup);
}
/* scan GdaSetGroup list */
@@ -828,10 +823,10 @@ update_public_data (GdauiSet *set)
set->groups_list = g_slist_prepend (set->groups_list, dgroup);
continue;
}
- dgroup = gdaui_set_group_new ();
+ dgroup = gdaui_set_group_new (GDA_SET_GROUP (list->data));
+ gdaui_set_group_set_source (dgroup, g_hash_table_lookup (shash,
+ gda_set_group_get_source
(gdaui_set_group_get_group (dgroup))));
set->groups_list = g_slist_prepend (set->groups_list, dgroup);
- gdaui_set_group_set_group (dgroup, GDA_SET_GROUP (list->data));
- gdaui_set_group_set_source (dgroup, g_hash_table_lookup (shash, dgroup->group->nodes_source));
}
set->groups_list = g_slist_reverse (set->groups_list);
@@ -855,9 +850,9 @@ compute_shown_columns_index (GdauiSetSource *dsource)
gint ncols, nholders;
gint *mask = NULL, masksize = 0;
- nholders = g_slist_length (dsource->source->nodes);
+ nholders = gda_set_source_get_n_nodes (gdaui_set_source_get_source (dsource));
g_return_if_fail (nholders > 0);
- ncols = gda_data_model_get_n_columns (GDA_DATA_MODEL (dsource->source->data_model));
+ ncols = gda_data_model_get_n_columns (gda_set_source_get_data_model (gdaui_set_source_get_source
(dsource)));
g_return_if_fail (ncols > 0);
if (ncols > nholders) {
@@ -867,10 +862,10 @@ compute_shown_columns_index (GdauiSetSource *dsource)
masksize = ncols - nholders;
mask = g_new0 (gint, masksize);
for (i = 0; i < ncols ; i++) {
- GSList *list = dsource->source->nodes;
+ GSList *list = gda_set_source_get_nodes (gdaui_set_source_get_source (dsource));
gboolean found = FALSE;
while (list && !found) {
- if (GDA_SET_NODE (list->data)->source_column == i)
+ if (gda_set_node_get_source_column (GDA_SET_NODE (list->data)) == i)
found = TRUE;
else
list = g_slist_next (list);
@@ -901,9 +896,9 @@ compute_ref_columns_index (GdauiSetSource *dsource)
gint ncols, nholders;
gint *mask = NULL, masksize = 0;
- nholders = g_slist_length (dsource->source->nodes);
+ nholders = gda_set_source_get_n_nodes (gdaui_set_source_get_source (dsource));
g_return_if_fail (nholders > 0);
- ncols = gda_data_model_get_n_columns (GDA_DATA_MODEL (dsource->source->data_model));
+ ncols = gda_data_model_get_n_columns (gda_set_source_get_data_model (gdaui_set_source_get_source
(dsource)));
g_return_if_fail (ncols > 0);
if (ncols > nholders) {
@@ -913,10 +908,10 @@ compute_ref_columns_index (GdauiSetSource *dsource)
masksize = ncols - nholders;
mask = g_new0 (gint, masksize);
for (i=0; i<ncols ; i++) {
- GSList *list = dsource->source->nodes;
+ GSList *list = gda_set_source_get_nodes (gdaui_set_source_get_source (dsource));
gboolean found = FALSE;
while (list && !found) {
- if (GDA_SET_NODE (list->data)->source_column == i)
+ if (gda_set_node_get_source_column (GDA_SET_NODE (list->data)) == i)
found = TRUE;
else
list = g_slist_next (list);
diff --git a/libgda-ui/gdaui-set.h b/libgda-ui/gdaui-set.h
index 8f2f1dc..b9df5ab 100644
--- a/libgda-ui/gdaui-set.h
+++ b/libgda-ui/gdaui-set.h
@@ -56,7 +56,7 @@ struct _GdauiSetGroup {
#define GDAUI_SET_GROUP(x) ((GdauiSetGroup*)(x))
GType gdaui_set_group_get_type (void) G_GNUC_CONST;
-GdauiSetGroup *gdaui_set_group_new (void);
+GdauiSetGroup *gdaui_set_group_new (GdaSetGroup *group);
void gdaui_set_group_free (GdauiSetGroup *sg);
GdauiSetGroup *gdaui_set_group_copy (GdauiSetGroup *sg);
void gdaui_set_group_set_source (GdauiSetGroup *sg, GdauiSetSource *source);
@@ -89,7 +89,7 @@ struct _GdauiSetSource {
#define GDAUI_TYPE_SET_SOURCE (gdaui_set_source_get_type ())
#define GDAUI_SET_SOURCE(x) ((GdauiSetSource*)(x))
GType gdaui_set_source_get_type (void) G_GNUC_CONST;
-GdauiSetSource *gdaui_set_source_new (void);
+GdauiSetSource *gdaui_set_source_new (GdaSetSource *source);
void gdaui_set_source_free (GdauiSetSource *s);
GdauiSetSource *gdaui_set_source_copy (GdauiSetSource *s);
void gdaui_set_source_set_source (GdauiSetSource *s, GdaSetSource *source);
diff --git a/libgda/gda-set.c b/libgda/gda-set.c
index 375e2a9..a5d5670 100644
--- a/libgda/gda-set.c
+++ b/libgda/gda-set.c
@@ -84,19 +84,26 @@ gda_set_group_get_type (void)
/**
* gda_set_group_new:
+ * @node: a #GdaSetNode struct
*
- * Creates a new #GdaSetGroup struct.
+ * Creates a new #GdaSetGroup struct. If @source is %NULL then new group contains
+ * just one #GdaSetNode.
*
* Return: (transfer full): a new #GdaSetGroup struct.
*
* Since: 5.2
*/
GdaSetGroup*
-gda_set_group_new (void)
+gda_set_group_new (GdaSetNode *node)
{
- GdaSetGroup *sg = g_new0 (GdaSetGroup, 1);
+ GdaSetGroup *sg;
+
+ g_return_val_if_fail (node, NULL);
+
+ sg = g_new0 (GdaSetGroup, 1);
sg->nodes_source = NULL;
sg->nodes = NULL;
+ sg->nodes = g_slist_append (sg->nodes, node);
return sg;
}
@@ -116,8 +123,8 @@ gda_set_group_copy (GdaSetGroup *sg)
g_return_val_if_fail (sg, NULL);
GdaSetGroup *n;
- n = gda_set_group_new ();
- n->nodes_source = g_object_ref (sg->nodes_source);
+ n = g_new0 (GdaSetGroup, 1);
+ n->nodes_source = sg->nodes_source;
n->nodes = g_slist_copy (sg->nodes);
return n;
}
@@ -145,7 +152,8 @@ gda_set_group_free (GdaSetGroup *sg)
*
* Since: 5.2
*/
-void gda_set_group_set_source (GdaSetGroup *sg, GdaSetSource *source)
+void
+gda_set_group_set_source (GdaSetGroup *sg, GdaSetSource *source)
{
g_return_if_fail (sg);
sg->nodes_source = source;
@@ -196,7 +204,7 @@ gda_set_group_get_node (GdaSetGroup *sg)
{
g_return_val_if_fail (sg, NULL);
g_return_val_if_fail (sg->nodes, NULL);
- return (GdaSetNode*) sg->nodes->data;
+ return GDA_SET_NODE (sg->nodes->data);
}
/**
@@ -287,6 +295,7 @@ gda_set_source_get_type (void)
GdaSetSource*
gda_set_source_new (GdaDataModel *model)
{
+ g_return_val_if_fail (model != NULL && GDA_IS_DATA_MODEL (model), NULL);
GdaSetSource *s = g_new0 (GdaSetSource, 1);
s->nodes = NULL;
s->data_model = g_object_ref (model);
@@ -361,7 +370,7 @@ void
gda_set_source_set_data_model (GdaSetSource *s, GdaDataModel *model)
{
g_return_if_fail (s);
- g_return_if_fail (G_IS_OBJECT (model));
+ g_return_if_fail (GDA_IS_DATA_MODEL (model));
s->data_model = g_object_ref (model);
}
@@ -398,6 +407,20 @@ gda_set_source_get_nodes (GdaSetSource *s)
return s->nodes;
}
+/**
+ * gda_set_source_get_n_nodes:
+ * @s: a #GdaSetSource
+ *
+ * Returns: number of nodes in @sg.
+ *
+ * Since: 5.2
+ */
+gint
+gda_set_source_get_n_nodes (GdaSetSource *s)
+{
+ g_return_val_if_fail (s, -1);
+ return g_slist_length (s->nodes);
+}
#ifdef GSEAL_ENABLE
/**
* GdaSetNode:
@@ -440,7 +463,6 @@ gda_set_node_get_type (void)
/**
* gda_set_node_new:
* @holder: a #GdaHolder to used by new #GdaSetNode
- * @model: a #GdaDataModel used to get values from
*
* Creates a new #GdaSetNode struct.
*
@@ -449,19 +471,12 @@ gda_set_node_get_type (void)
* Since: 5.2
*/
GdaSetNode*
-gda_set_node_new (GdaHolder *holder, GdaDataModel *model)
+gda_set_node_new (GdaHolder *holder)
{
g_return_val_if_fail (GDA_IS_HOLDER (holder), NULL);
GdaSetNode *n = g_new0 (GdaSetNode, 1);
n->holder = holder;
- if (GDA_IS_DATA_MODEL (model)) {
- n->source_model = model;
- n->source_column = 0;
- }
- else {
- n->source_model = NULL;
- n->source_column = -1;
- }
+ n->source_model = NULL;
return n;
}
@@ -481,8 +496,10 @@ gda_set_node_copy (GdaSetNode *node)
g_return_val_if_fail (node, NULL);
GdaSetNode *n;
- n = gda_set_node_new (gda_set_node_get_holder (node), gda_set_node_get_data_model (node));
+ n = gda_set_node_new (gda_set_node_get_holder (node));
gda_set_node_set_source_column (n, gda_set_node_get_source_column (node));
+ gda_set_node_set_holder (n, gda_set_node_get_holder (node));
+ gda_set_node_set_data_model (n, gda_set_node_get_data_model (node));
return n;
}
@@ -499,10 +516,6 @@ gda_set_node_free (GdaSetNode *node)
{
if (node == NULL)
return;
- if (GDA_IS_HOLDER (node->holder))
- g_object_unref (node->holder);
- if (GDA_IS_DATA_MODEL (node->source_model))
- g_object_unref (node->source_model);
g_free (node);
}
@@ -525,17 +538,16 @@ gda_set_node_get_holder (GdaSetNode *node)
* gda_set_node_set_holder:
* @node: a #GdaSetNode struct to set holder to
*
- * Set a #GdaHolder to @node. @holder increment its referen counting when assigned.
+ * Set a #GdaHolder to @node.
*
* Since: 5.2
*/
void
gda_set_node_set_holder (GdaSetNode *node, GdaHolder *holder)
{
+ g_return_if_fail (node);
g_return_if_fail (GDA_IS_HOLDER (holder));
- if (GDA_IS_HOLDER (node->holder))
- g_object_unref (node->holder);
- node->holder = g_object_ref (holder);
+ node->holder = holder;
}
/**
@@ -556,7 +568,7 @@ gda_set_node_get_data_model (GdaSetNode *node)
/**
* gda_set_node_set_data_model:
* @node: a #GdaSetNode struct to set data model to
- * @model: a #GdaDataModel to be used by @node
+ * @model: (allow-none): a #GdaDataModel to be used by @node
*
* Set a #GdaDataModel to be used by @node. @model increment its reference
* counting when set. Internally referenced column number is set to first column
@@ -568,11 +580,14 @@ void
gda_set_node_set_data_model (GdaSetNode *node, GdaDataModel *model)
{
g_return_if_fail (node);
- g_return_if_fail (GDA_IS_DATA_MODEL (model));
- if (GDA_IS_DATA_MODEL (node->source_model))
- g_object_unref (node->source_model);
- node->source_model = g_object_ref (model);
- node->source_column = 0;
+ if (GDA_IS_DATA_MODEL (model)) {
+ node->source_model = model;
+ node->source_column = 0;
+ }
+ else {
+ node->source_model = NULL;
+ node->source_column = -1;
+ }
}
/**
@@ -1775,8 +1790,6 @@ compute_public_data (GdaSet *set)
GdaSetSource *source;
GdaSetGroup *group;
GHashTable *groups = NULL;
- GdaHolder *holder;
- GdaDataModel *node_model;
/*
* Get rid of all the previous structures
@@ -1794,14 +1807,12 @@ compute_public_data (GdaSet *set)
* Creation of the GdaSetNode structures
*/
for (list = set->holders; list; list = list->next) {
- holder = GDA_HOLDER (list->data);
- if (GDA_IS_HOLDER (holder)) {
- gint col;
- node = gda_set_node_new (holder, gda_holder_get_source_model (holder, &col));
- gda_set_node_set_source_column (node, col);
- if (node)
- set->nodes_list = g_slist_prepend (set->nodes_list, node);
- }
+ GdaHolder *holder = GDA_HOLDER (list->data);
+ gint col;
+ node = gda_set_node_new (holder);
+ gda_set_node_set_data_model (node, gda_holder_get_source_model (holder, &col));
+ gda_set_node_set_source_column (node, col);
+ set->nodes_list = g_slist_prepend (set->nodes_list, node);
}
set->nodes_list = g_slist_reverse (set->nodes_list);
@@ -1813,13 +1824,12 @@ compute_public_data (GdaSet *set)
/* source */
source = NULL;
- node_model = gda_set_node_get_data_model (node);
- if (GDA_IS_DATA_MODEL (node_model)) {
- source = gda_set_get_source_for_model (set, node_model);
+ if (gda_set_node_get_data_model (node)) {
+ source = gda_set_get_source_for_model (set, gda_set_node_get_data_model (node));
if (source)
gda_set_source_add_node (source, node);
else {
- source = gda_set_source_new (node_model);
+ source = gda_set_source_new (gda_set_node_get_data_model (node));
gda_set_source_add_node (source, node);
set->sources_list = g_slist_prepend (set->sources_list, source);
}
@@ -1827,20 +1837,19 @@ compute_public_data (GdaSet *set)
/* group */
group = NULL;
- if (GDA_IS_DATA_MODEL (node_model) && groups)
- group = g_hash_table_lookup (groups, node_model);
+ if (gda_set_node_get_data_model (node) && groups)
+ group = g_hash_table_lookup (groups, gda_set_node_get_data_model (node));
if (group)
gda_set_group_add_node (group, node);
else {
- group = gda_set_group_new ();
- gda_set_group_add_node (group, node);
+ group = gda_set_group_new (node);
gda_set_group_set_source (group, source);
set->groups_list = g_slist_prepend (set->groups_list, group);
- if (GDA_IS_DATA_MODEL (node_model)) {
+ if (gda_set_node_get_data_model (node)) {
if (!groups)
groups = g_hash_table_new (NULL, NULL); /* key = source model,
- value = GdaSetGroup */
- g_hash_table_insert (groups, node_model, group);
+ value = GdaSetGroup */
+ g_hash_table_insert (groups, gda_set_node_get_data_model (node), group);
}
}
}
@@ -1932,7 +1941,7 @@ gda_set_real_add_holder (GdaSet *set, GdaHolder *holder)
}
similar = (GdaHolder*) g_hash_table_lookup (set->priv->holders_hash, hid);
- if (GDA_IS_HOLDER (similar)) {
+ if (!similar) {
/* really add @holder to the set */
set->holders = g_slist_append (set->holders, holder);
g_hash_table_insert (set->priv->holders_hash, (gchar*) hid, holder);
@@ -2031,7 +2040,7 @@ gda_set_is_valid (GdaSet *set, GError **error)
g_return_val_if_fail (set->priv, FALSE);
for (holders = set->holders; holders; holders = holders->next) {
- if (!gda_holder_is_valid ((GdaHolder*) holders->data)) {
+ if (!gda_holder_is_valid (GDA_HOLDER (holders->data))) {
g_set_error (error, GDA_SET_ERROR, GDA_SET_INVALID_ERROR,
"%s", _("One or more values are invalid"));
return FALSE;
@@ -2191,7 +2200,6 @@ gda_set_get_group (GdaSet *set, GdaHolder *holder)
g_return_val_if_fail (g_slist_find (set->holders, holder), NULL);
for (list = set->groups_list; list && !retval; list = list->next) {
- GSList *l;
retval = GDA_SET_GROUP (list->data);
sublist = gda_set_group_get_nodes (retval);
while (sublist && !retval) {
diff --git a/libgda/gda-set.h b/libgda/gda-set.h
index a6ff349..fdcaaaf 100644
--- a/libgda/gda-set.h
+++ b/libgda/gda-set.h
@@ -57,7 +57,7 @@ struct _GdaSetNode {
#define GDA_TYPE_SET_NODE (gda_set_node_get_type ())
#define GDA_SET_NODE(x) ((GdaSetNode *)(x))
GType gda_set_node_get_type (void) G_GNUC_CONST;
-GdaSetNode *gda_set_node_new (GdaHolder *holder, GdaDataModel *model);
+GdaSetNode *gda_set_node_new (GdaHolder *holder);
void gda_set_node_free (GdaSetNode *node);
GdaSetNode *gda_set_node_copy (GdaSetNode *node);
GdaHolder *gda_set_node_get_holder (GdaSetNode *node);
@@ -83,7 +83,7 @@ struct _GdaSetGroup {
#define GDA_TYPE_SET_GROUP (gda_set_group_get_type ())
#define GDA_SET_GROUP(x) ((GdaSetGroup *)(x))
GType gda_set_group_get_type (void) G_GNUC_CONST;
-GdaSetGroup *gda_set_group_new (void);
+GdaSetGroup *gda_set_group_new (GdaSetNode *node);
void gda_set_group_free (GdaSetGroup *sg);
GdaSetGroup *gda_set_group_copy (GdaSetGroup *sg);
void gda_set_group_add_node (GdaSetGroup *sg, GdaSetNode *node);
@@ -116,6 +116,7 @@ void gda_set_source_free (GdaSetSource *s);
GdaSetSource *gda_set_source_copy (GdaSetSource *s);
void gda_set_source_add_node (GdaSetSource *s, GdaSetNode *node);
GSList *gda_set_source_get_nodes (GdaSetSource *s);
+gint gda_set_source_get_n_nodes (GdaSetSource *s);
GdaDataModel *gda_set_source_get_data_model (GdaSetSource *s);
void gda_set_source_set_data_model (GdaSetSource *s, GdaDataModel *model);
diff --git a/libgda/libgda-5.0.vapi b/libgda/libgda-5.0.vapi
index 2caa362..e19241c 100644
--- a/libgda/libgda-5.0.vapi
+++ b/libgda/libgda-5.0.vapi
@@ -867,7 +867,7 @@ namespace Gda {
public GLib.List<Gda.SetNode> nodes;
public weak Gda.SetSource nodes_source;
[CCode (has_construct_function = false)]
- public SetGroup ();
+ public SetGroup (Gda.SetNode node);
public void add_node (Gda.SetNode node);
public Gda.SetGroup copy ();
public void free ();
@@ -884,13 +884,13 @@ namespace Gda {
public int source_column;
public weak Gda.DataModel source_model;
[CCode (has_construct_function = false)]
- public SetNode (Gda.Holder holder, Gda.DataModel model);
+ public SetNode (Gda.Holder holder);
public Gda.SetNode copy ();
public void free ();
public unowned Gda.DataModel get_data_model ();
public unowned Gda.Holder get_holder ();
public int get_source_column ();
- public void set_data_model (Gda.DataModel model);
+ public void set_data_model (Gda.DataModel? model);
public void set_holder (Gda.Holder holder);
public void set_source_column (int column);
}
@@ -905,6 +905,7 @@ namespace Gda {
public Gda.SetSource copy ();
public void free ();
public unowned Gda.DataModel get_data_model ();
+ public int get_n_nodes ();
public unowned GLib.SList<Gda.SetNode> get_nodes ();
public void set_data_model (Gda.DataModel model);
}
diff --git a/libgda/libgda.symbols b/libgda/libgda.symbols
index 7bac4d3..e1aa754 100644
--- a/libgda/libgda.symbols
+++ b/libgda/libgda.symbols
@@ -670,8 +670,9 @@
gda_set_source_free
gda_set_source_copy
gda_set_source_add_node
- gda_set_source_get_nodes
gda_set_source_get_data_model
+ gda_set_source_get_n_nodes
+ gda_set_source_get_nodes
gda_set_source_set_data_model
gda_short_get_type
gda_sql_any_part_check_structure
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]