2006/1/26, Bas Driessen <[EMAIL PROTECTED]>:
[...]
>
>  Thanks Vivian, that works OK. 1 record added to the table in the database
> and 1 row added to the datamodel. Perfect! Just a concern. This will now
> only work for hash implementations. I believe that the MySQL provider uses
> something else (have to look into again). Can we make this change more
> generic?

I did the changes and added a g_object_unref(row) because otherwise
there may be some problems. can you try the following:

static GdaRow *
gda_data_model_hash_append_values (GdaDataModelRow *model, const GList
*values, GError **error)
{
        gint len;
        GdaRow *row = NULL;

        g_return_val_if_fail (GDA_IS_DATA_MODEL_HASH (model), NULL);
        g_return_val_if_fail (values != NULL, NULL);

        len = g_list_length ((GList *) values);
        if (len != GDA_DATA_MODEL_HASH (model)->priv->number_of_columns) {
                g_set_error (error, 0, GDA_DATA_MODEL_VALUES_LIST_ERROR,
                             _("Wrong number of values in values list"));
                return NULL;
        }

        row = gda_row_new_from_list (GDA_DATA_MODEL (model), values);
        if (!GDA_DATA_MODEL_ROW_CLASS (G_OBJECT_GET_CLASS
(model))->append_row (model, row, error)) {
                g_object_unref (row);
                return NULL;
        }

        g_object_unref (row);
        return (GdaRow *) row;
}

Thanks,

Vivien
_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to