Re: [gnome-db] gda_data_model_import_from_model ()

Vivien Malerba <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <[email protected]>
2009/7/20 Massimo Cora' <[email protected]>

> -----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

_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list
DataModelConcat.tbz (application/x-bzip-compressed-tar, 5.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.