[libgda/LIBGDA_4.0] Implemented the freeze/thaw feature in GdaDataSelect



commit af1ae9dae485df666c5d56f1aa17858b515ead7d
Author: Vivien Malerba <malerba gnome-db org>
Date:   Fri Feb 26 21:40:48 2010 +0100

    Implemented the freeze/thaw feature in GdaDataSelect

 libgda/gda-data-select.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-data-select.c b/libgda/gda-data-select.c
index 6787491..491e9d2 100644
--- a/libgda/gda-data-select.c
+++ b/libgda/gda-data-select.c
@@ -85,6 +85,7 @@ struct _GdaDataSelectPrivate {
 	GArray                 *del_rows; /* array[index] = number of the index'th deleted row,
 					   * sorted by row number (row numbers are internal row numbers )*/
 	GHashTable             *upd_rows; /* key = internal row number + 1, value = a DelayedSelectStmt pointer */
+	gboolean                notify_changes;
 };
 
 /* properties */
@@ -162,6 +163,8 @@ static gboolean             gda_data_select_set_values      (GdaDataModel *model
 							     GError **error);
 static gint                 gda_data_select_append_values   (GdaDataModel *model, const GList *values, GError **error);
 static gboolean             gda_data_select_remove_row      (GdaDataModel *model, gint row, GError **error);
+static void                 gda_data_select_set_notify      (GdaDataModel *model, gboolean do_notify_changes);
+static gboolean             gda_data_select_get_notify      (GdaDataModel *model);
 
 static GObjectClass *parent_class = NULL;
 
@@ -297,8 +300,8 @@ gda_data_select_data_model_init (GdaDataModelIface *iface)
 	iface->i_remove_row = gda_data_select_remove_row;
 	iface->i_find_row = NULL;
 	
-	iface->i_set_notify = NULL;
-	iface->i_get_notify = NULL;
+	iface->i_set_notify = gda_data_select_set_notify;
+	iface->i_get_notify = gda_data_select_get_notify;
 	iface->i_send_hint = NULL;
 }
 
@@ -309,6 +312,7 @@ gda_data_select_init (GdaDataSelect *model, GdaDataSelectClass *klass)
 	g_return_if_fail (GDA_IS_DATA_SELECT (model));
 	model->priv = g_new0 (GdaDataSelectPrivate, 1);
 	model->priv->cnc = NULL;
+	model->priv->notify_changes = TRUE;
 	model->priv->rows = g_array_new (FALSE, FALSE, sizeof (GdaRow *));
 	model->priv->index = g_hash_table_new (g_direct_hash, g_direct_equal);
 	model->prep_stmt = NULL;
@@ -3014,6 +3018,18 @@ gda_data_select_remove_row (GdaDataModel *model, gint row, GError **error)
 	return TRUE;
 }
 
+static void
+gda_data_select_set_notify (GdaDataModel *model, gboolean do_notify_changes)
+{
+	((GdaDataSelect *) model)->priv->notify_changes = do_notify_changes;
+}
+
+static gboolean
+gda_data_select_get_notify (GdaDataModel *model)
+{
+	return ((GdaDataSelect *) model)->priv->notify_changes;
+}
+
 /*
  * The following function creates a correspondance between the parameters required to
  * execute the model->one_row_select_stmt statement (GdaHolders named "-<num>", in ), and the GdaHolder



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]