Re: [gnome-db] gda_data_model_import_from_model ()





2009/7/20 Massimo Cora' <maxcvs email it>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Vivien,

Vivien Malerba wrote:
>
>
> There is no reason the default GdaDataModel iter's implementation should
> not work. Can you send me a standalone version of your code so I can try
> to figure out what the problem is?
>
> Anyway, even though the GdaDataModelIter is not an interface, you can
> still subclass it if you need, and then implement the
> GdaDataModel::i_create_iter method to instanciate your own GdaDataModelIter.
>

sure here it is. Just compile and execute with
gcc gda-data-model-concat.c example.c `pkg-config --cflags --libs
libgda-4.0` `pkg-config --cflags --libs glib-2.0` -o example && ./example

As you see from the example, I first try to use the GdaDataModelIter,
unsuccesfully, secondly I just try to query the items directly from the
GdaDataModelConcat, successfully.

Honestly I didn't get why gda-data-model has a virtual method
gda_data_model_iter_at_row, which seems to be implemented in
GdaDataSelect but with too much logic.

Here is a slightly modified version of your code, to make it work. Here is what I've modified:
* you don't need to bother about iterators, I've removed all that code
* you _need_ to implement the  i_get_access_flags() virtual method (this is why it failed)
* check that the data models being concatenated support random access mode

If you want to be able to concatenate non random access data models, it's a bit more difficult, but I can help you.

Vivien

Attachment: DataModelConcat.tbz
Description: application/bzip-compressed-tar



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