Sorry, I misread the request.
In this case, if I have now understood correctly, you are opening the
source before retrieving the layer.
That would then be everything up to the first '|'.
For a file-base source the full-filename with path.
For a Database-System such as PostGis the Connection-String to connect to
the Database (with user/password-information).
After the connection has been made use GetName or GetLayer as needed from
the information supplied after the first '|' to retrieve the layer.
When the Layer-Name is unique, GetName should be used
- for drivers such as GML and KML, where the Layer-Name may not be unique,
Getlayer should be used
Qgis-developer mailing list
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer