[Qgis-developer] Re: question about location of providerregistry
wonder.sk at gmail.com
Tue Feb 20 09:15:29 EST 2007
provider registry is in core library as it's needed to lookup
providers used for opening layers. But plugin registry isn't something
that we want to give to users of the libs - at least I don't see any
purpose. Moreover plugins are connected also with gui library - they
might need to access map canvas etc.
In my opinion, accessing plugins directly from core library is not
good. There must be other way how to do it. How to solve it - imagine
that the functionality is implemented directly in core library and not
in a plugin - that's also a possible case.
What about creating an interface e.g. QgsMapLayerMetadata which would
have methods readXML() and writeXML() and maybe some more. Some
classes would implement this interface to enable reading/storing some
data. Every layer could have a list of metadata - e.g. labeling
information, diagram information etc. Vector layer would not need to
care about what exactly they are, just call read/write XML function on
layer load/save. Do you like this idea?
On 2/19/07, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch> wrote:
> In svn head, qgsproviderregistry.h is in core/ directory and
> qgspluginregistry.h in app/ directory. I wanted to ask what the reason for
> this is.
> Backgournd of my question is that I'm trying to restore the diagram overlay
> from project file. For this, QgsVectorLayer needs to have a pointer to the
> diagram plugin (in case it is loaded). From a pure technical point of view
> this is similar to QgsVectorLayer using QgsProviderRegistry to restore a data
> provider from project file. But because plugin registry is in app, vector
> layer is not allowed to use it, as code in core should not depend on code in
> Is it possible that QgsPluginRegistry could be in core? Or is there a more
> intelligent way of getting the plugin pointer?
More information about the Qgis-developer