[libgda] GdaBrowser: handle cases when gda_holder_set_source_model() returned an error
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: handle cases when gda_holder_set_source_model() returned an error
- Date: Thu, 16 Dec 2010 18:38:31 +0000 (UTC)
commit ec4c4cb4e7510f3dba143cee33074b9402cae634
Author: Vivien Malerba <malerba gnome-db org>
Date: Thu Dec 16 18:51:21 2010 +0100
GdaBrowser: handle cases when gda_holder_set_source_model() returned an error
tools/browser/schema-browser/table-info.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/tools/browser/schema-browser/table-info.c b/tools/browser/schema-browser/table-info.c
index 636ba28..ed3613f 100644
--- a/tools/browser/schema-browser/table-info.c
+++ b/tools/browser/schema-browser/table-info.c
@@ -608,14 +608,23 @@ fk_bind_select_executed_cb (G_GNUC_UNUSED BrowserConnection *bcnc,
break;
}
else {
+ gboolean bound;
+ bound = gda_holder_set_source_model (h, model, i, NULL);
#ifdef GDA_DEBUG_NO
- if (gda_holder_set_source_model (h, model, i, NULL))
+ if (bound)
g_print ("Bound holder [%s] to column %d for model %p\n", gda_holder_get_id (h), i, model);
else
g_print ("Could not bind holder [%s] to column %d\n", gda_holder_get_id (h), i);
-#else
- gda_holder_set_source_model (h, model, i, NULL);
#endif
+ if (!bound) {
+ /* There was an error => unbind all the parameters */
+ for (i = 0; i < fkdata->cols_nb; i++) {
+ h = g_hash_table_lookup (fkdata->chash,
+ GINT_TO_POINTER (fkdata->fk_cols_array [i] - 1));
+ gda_holder_set_source_model (h, NULL, 0, NULL);
+ }
+ break;
+ }
}
}
fkdata->model = g_object_ref (out_result);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]