Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-23 Thread Etienne Tourigny
Hi, I have worked on implementing this, please give me any comments. https://github.com/etiennesky/Quantum-GIS/tree/browser_scanitems There a few few things missing (like error messages) and a few rough edges, but it works for opening vector, raster and zip datasets in commandline, file open as

Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-22 Thread Etienne Tourigny
Hi, I followed your suggestion and created a QgsDataSource class, which has been sub-classed in ogr and gdal providers (with just a tad more definitions). I could use another piece of advise... The app opens a dialog when there are sublayers, so the user can choose which layer(s) are to be opene

Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-21 Thread Martin Dobias
On Wed, Nov 21, 2012 at 12:14 PM, Etienne Tourigny wrote: > I agree that it would be good to implement this idea. However it > requires a few changes in the API. > > Could this be done before 2.0, or after? As it won't cause breakage > it probably would be ok to add afterwards. But I think that

Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-21 Thread Etienne Tourigny
Hi I agree that it would be good to implement this idea. However it requires a few changes in the API. Could this be done before 2.0, or after? As it won't cause breakage it probably would be ok to add afterwards. But I think that if it's done after 2.0 not many plugins will use it. However, th

Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-20 Thread Martin Dobias
On Tue, Nov 20, 2012 at 6:16 PM, Etienne Tourigny wrote: > > > Unfortunately the code that handles sublayer loading is in QgisApp, > and I would like to add some tests for this in case it gets broken in > the future. It broke a few months ago for rasters, and there ia a case > where it doesn't work

Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-20 Thread Etienne Tourigny
Hi I understand that QgisAppInterface should only be available wen running the app. I am working with sublayer handling, which is not handled my QgsRasterLayer / QgsVectorLayer . Have a closer look at the various addRasterLayers and it's not as simple as you write (in part my fault - I hacked ar

Re: [Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-20 Thread Martin Dobias
On Tue, Nov 20, 2012 at 5:52 PM, Etienne Tourigny wrote: > Hi, > > I am trying to add some tests for the addRasterLayer() and > addVectorLayer() members in QgisApp, and it seems I cannot have access > to them from the test environment. > [...] How to get the "real" QgsAppInterface like when u

[Qgis-developer] acecss to qgisapp / qgisappinterface from tests (c++ or python?)

2012-11-20 Thread Etienne Tourigny
Hi, I am trying to add some tests for the addRasterLayer() and addVectorLayer() members in QgisApp, and it seems I cannot have access to them from the test environment. I tried including qgisapp.h, but that needed an extra rule in CMakeLists (to add src/app to INCLUDE_DIRECTORIES), but this gener