<br><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 20, 2012 at 6:16 PM, Etienne Tourigny <span dir="ltr"><<a href="mailto:etourigny.dev@gmail.com" target="_blank">etourigny.dev@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Unfortunately the code that handles sublayer loading is in QgisApp,<br>
and I would like to add some tests for this in case it gets broken in<br>
the future. It broke a few months ago for rasters, and there ia a case<br>
where it doesn't work for vectors.<br>
<br>
Would you have a suggestion as to how we can improve this - i.e.<br>
manage sublayers outside of QgisApp?<br></blockquote><div><br></div><div>I think the sublayer handling should be done at the provider level. What is currently missing in QGIS is a notion of collection of layers. For example, OGR has "data sources" (usually a directory, server connection etc) which can be used for listing and accessing sublayers in a generic way - we need something like this also for QGIS provider implementations. Some providers already have some code going into this direction, but it's not exposed under a common API (e.g. QgsVectorDataSource class) - there is QgsPostgresConn or QgsSpatiaLiteConnection.</div>
<div><br></div><div>The support for data sources would be also very handy for generic operations on layers (create, remove, rename).</div><div><br></div><div>Regards</div><div>Martin</div><div><br></div></div></div>