[libgda] data-model-dsn-list: fix object's private implementation



commit e65e36878f54c12b435c9b9a2699d64ab7b438a2
Author: Daniel Espinosa <esodan gmail com>
Date:   Sat Sep 8 19:15:05 2018 -0500

    data-model-dsn-list: fix object's private implementation

 libgda/gda-data-model-dsn-list.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libgda/gda-data-model-dsn-list.c b/libgda/gda-data-model-dsn-list.c
index 221e6068f..db37cc542 100644
--- a/libgda/gda-data-model-dsn-list.c
+++ b/libgda/gda-data-model-dsn-list.c
@@ -88,11 +88,9 @@ gda_data_model_dsn_list_init (GdaDataModelDsnList *model)
 {
        GdaConfig *config;
        GdaColumn *col;
+       GdaDataModelDsnList *dmodel = GDA_DATA_MODEL_DSN_LIST (model);
+       GdaDataModelDsnListPrivate *priv = gda_data_model_dsn_list_get_instance_private (dmodel);
 
-       g_return_if_fail (GDA_IS_DATA_MODEL_DSN_LIST (model));
-       GdaDataModelDsnListPrivate *priv = gda_data_model_dsn_list_get_instance_private (model);
-
-       priv = g_new0 (GdaDataModelDsnListPrivate, 1);
        priv->nb_dsn = gda_config_get_nb_dsn ();
        priv->row_to_remove = -1;
        
@@ -157,6 +155,8 @@ gda_data_model_dsn_list_class_init (GdaDataModelDsnListClass *klass)
 
        parent_class = g_type_class_peek_parent (klass);
 
+       g_type_class_add_private (object_class, sizeof (GdaDataModelDsnListPrivate));
+
        object_class->dispose = gda_data_model_dsn_list_dispose;
 }
 


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