<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:"sans serif";font-size:12px;white-space:pre-wrap">So if we want to address both we need the layer_id and layer_name. I'd say when you build a OGR URI (mostly in QgisApp::</span><wbr style="font-family:"sans serif";font-size:12px;white-space:pre-wrap"><span style="font-family:"sans serif";font-size:12px;white-space:pre-wrap">askUserForOGRSublayers()), then look at the uniqueness of the layer names. If there's layer name unicity, then use only the layer name. Otherwise fallback to uniquely the layer_id (and well in that case if the datasource changes at some point, we might have an issue indeed)</span></blockquote><div><br></div><div>This is already being done in my version.</div><div><br></div><div>Setting the id to -1 could tell the QgsOgrProvider that the layername is unique</div><div>- and remove the need of the extra parameter</div><div><br></div><div>id >= 0 would tell QgsOgrProvider that the id MUST be used, because there are duplicate layernames.</div><div><br></div><div>The id and layername will be stored (as it was before) in the URI/Project.</div><div><br></div><div>Since at this point it is known that the values are valid</div><div>- no further checks are needed and can be opened directly</div><div><br></div><div>Can we agree on this?</div><div>Anything else still open?</div><div><br></div><div>Mark</div><div><br></div><div><br></div></div>