[Qgis-developer] RFC vector data providers handling

Martin Dobias wonder.sk at gmail.com
Wed Apr 30 20:21:00 EDT 2008


On Tue, Apr 22, 2008 at 7:37 PM, Jürgen E. Fischer <jef at norbit.de> wrote:
>
>  Above is as good as a list of methods I'd like to add to the providers.
>  I intended to add class methods.  But we could also add and export
>  functions (or wrappers for the class methods;  similar to
>  fileVectorFilters()).
>
>  QGISEXTERN QStringList getConnections();
>  // would return a of registered connection names in the driver
>  // QgsSourceSelect would call it to fill the connection combobox after
>  // the provider is selected. This should also get an "New..." entry.
>
>  QGISEXTERN bool editConnection(QString connection);
>  // would be tied to the add/edit button and add/edit a selected
>  // connection in the combobox and open a provider specific dialog box.
>  // That gui could optionally include and "Add Layer..." button to create
>  // a new layer (ie. QgsGeomTypeDialog for OGR, but not tied to just
>  // shapes).
>
>  QGISEXTERN bool removeConnection(QString connection);
>  // would be tied to the remove button to remove the connection
>
>  QGISEXTERN QDomNode *getLayerList(QString connection);
>  // would be tied to the list layers button (to replace "Connect")
>  // and return a list of layers that is used to fill QgsSourceSelect
>  // lists layer list.
>
>  QGISEXTERN QgsMapLayer *getLayer(const QDomNode *);
>  // would instantiate a QgsMapLayer with a selected layer

Hi Jurgen,

with such set of functions we get close to the model used in OGR
(which I think we should start using too) which has:
- layer - same as QGIS layer
- data source - can consist of many layers - in QGIS there's no equivalent
- driver - more or less what's provider in QGIS

Adding notion of data sources we'll be able to solve several
long-standing thinks like creating new layers, managing connections to
databases and finally creating an unified vector/data loading dialog.

Just throwing some ideas ;-)

Martin


More information about the Qgis-developer mailing list