From 01434a529776f311a51dc2c35646c8eec8904694 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Tue, 15 Dec 2015 13:43:10 +0100 Subject: [PATCH] Added functions GdaExGrid::fill_frm_sqlbuilder_with_missing_func and ::fill_from_sqlbuilder. --- src/grid.c | 28 ++++++++++++++++++++++++++++ src/grid.h | 6 ++++++ 2 files changed, 34 insertions(+) diff --git a/src/grid.c b/src/grid.c index 69ab14b..b8111b4 100644 --- a/src/grid.c +++ b/src/grid.c @@ -516,6 +516,28 @@ gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid, return TRUE; } +gboolean +gdaex_grid_fill_from_sqlbuilder_with_missing_func (GdaExGrid *grid, + GdaEx *gdaex, + GdaExSqlBuilder *builder, + GdaExGridFillListStoreMissingFunc missing_func, gpointer user_data, + GError **error) +{ + GdaDataModel *dm; + + gboolean ret; + + g_return_val_if_fail (GDAEX_IS_GRID (grid), FALSE); + g_return_val_if_fail (IS_GDAEX (gdaex), FALSE); + g_return_val_if_fail (GDAEX_IS_SQLBUILDER (builder), FALSE); + + dm = gdaex_sql_builder_query (builder, gdaex, NULL); + ret = gdaex_grid_fill_from_datamodel_with_missing_func (grid, dm, missing_func, user_data, error); + g_object_unref (dm); + + return ret; +} + gboolean gdaex_grid_fill_from_sql (GdaExGrid *grid, GdaEx *gdaex, const gchar *sql, GError **error) { @@ -528,6 +550,12 @@ gdaex_grid_fill_from_datamodel (GdaExGrid *grid, GdaDataModel *dm, GError **erro return gdaex_grid_fill_from_datamodel_with_missing_func (grid, dm, NULL, NULL, error); } +gboolean +gdaex_grid_fill_from_sqlbuilder (GdaExGrid *grid, GdaEx *gdaex, GdaExSqlBuilder *builder, GError **error) +{ + return gdaex_grid_fill_from_sqlbuilder_with_missing_func (grid, gdaex, builder, NULL, NULL, error); +} + #ifdef SOLIPA_FOUND void gdaex_grid_set_solipa (GdaExGrid *grid, Solipa *solipa) diff --git a/src/grid.h b/src/grid.h index cd41e42..fe80636 100644 --- a/src/grid.h +++ b/src/grid.h @@ -84,9 +84,15 @@ gboolean gdaex_grid_fill_from_datamodel_with_missing_func (GdaExGrid *grid, GdaDataModel *dm, GdaExGridFillListStoreMissingFunc missing_func, gpointer user_data, GError **error); +gboolean gdaex_grid_fill_from_sqlbuilder_with_missing_func (GdaExGrid *grid, + GdaEx *gdaex, + GdaExSqlBuilder *sqlbuilder, + GdaExGridFillListStoreMissingFunc missing_func, gpointer user_data, + GError **error); gboolean gdaex_grid_fill_from_sql (GdaExGrid *grid, GdaEx *gdaex, const gchar *sql, GError **error); gboolean gdaex_grid_fill_from_datamodel (GdaExGrid *grid, GdaDataModel *dm, GError **error); +gboolean gdaex_grid_fill_from_sqlbuilder (GdaExGrid *grid, GdaEx *gdaex, GdaExSqlBuilder *builder, GError **error); #ifdef SOLIPA_FOUND void gdaex_grid_set_solipa (GdaExGrid *grid, Solipa *solipa); -- 2.49.0