Skip to content

Commit 8d03642

Browse files
authored
Merge pull request #4487 from nyalldawson/memory
Move memory provider to core
2 parents df679a2 + e2a735f commit 8d03642

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+690
-278
lines changed

debian/qgis-providers.install.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ usr/lib/qgis/plugins/libdelimitedtextprovider.so
44
usr/lib/qgis/plugins/libgdalprovider.so
55
usr/lib/qgis/plugins/libgpxprovider.so
66
usr/lib/qgis/plugins/libidentcertauthmethod.so
7-
usr/lib/qgis/plugins/libmemoryprovider.so
87
usr/lib/qgis/plugins/libmssqlprovider.so
98
usr/lib/qgis/plugins/libdb2provider.so
109
usr/lib/qgis/plugins/libogrprovider.so

doc/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ IF(WITH_APIDOC)
6666
${CMAKE_SOURCE_DIR}/src/core/metadata
6767
${CMAKE_SOURCE_DIR}/src/core/pal
6868
${CMAKE_SOURCE_DIR}/src/core/processing
69+
${CMAKE_SOURCE_DIR}/src/core/providers
70+
${CMAKE_SOURCE_DIR}/src/core/providers/memory
6971
${CMAKE_SOURCE_DIR}/src/core/raster
7072
${CMAKE_SOURCE_DIR}/src/core/scalebar
7173
${CMAKE_SOURCE_DIR}/src/core/symbology-ng

doc/api_break.dox

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,14 @@ QgsProjectPropertyValue {#qgis_api_break_3_0_QgsProjectPropertyValue}
16781678

16791679
- The unused count() and entryList() methods were removed.
16801680

1681+
QgsProviderRegistry {#qgis_api_break_3_0_QgsProviderRegistry}
1682+
-------------------
1683+
1684+
- provider() was renamed to createProvider()
1685+
- selectWidget() was renamed to createSelectionWidget()
1686+
- providerLibrary() was renamed to createProviderLibrary()
1687+
1688+
16811689
QgsRaster {#qgis_api_break_3_0_QgsRaster}
16821690
---------
16831691

ms-windows/osgeo4w/package.cmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-common/%PACKAGENAME
302302
"apps/%PACKAGENAME%/plugins/gdalprovider.dll" ^
303303
"apps/%PACKAGENAME%/plugins/gpxprovider.dll" ^
304304
"apps/%PACKAGENAME%/plugins/identcertauthmethod.dll" ^
305-
"apps/%PACKAGENAME%/plugins/memoryprovider.dll" ^
306305
"apps/%PACKAGENAME%/plugins/mssqlprovider.dll" ^
307306
"apps/%PACKAGENAME%/plugins/db2provider.dll" ^
308307
"apps/%PACKAGENAME%/plugins/ogrprovider.dll" ^

python/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ INCLUDE_DIRECTORIES(
107107
../src/core/layertree
108108
../src/core/metadata
109109
../src/core/processing
110+
../src/core/providers
111+
../src/core/providers/memory
110112
../src/core/raster
111113
../src/core/scalebar
112114
../src/core/symbology-ng

python/auto_sip.blacklist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ core/qgssnappingconfig.sip
5959
core/qgsprojectversion.sip
6060
core/qgsproperty.sip
6161
core/qgspropertycollection.sip
62-
core/qgsprovidermetadata.sip
63-
core/qgsproviderregistry.sip
6462
core/qgspythonrunner.sip
6563
core/qgsrange.sip
6664
core/qgsrelationmanager.sip

python/core/core.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@
286286
%Include processing/qgsprocessingregistry.sip
287287
%Include processing/qgsprocessingutils.sip
288288

289+
%Include providers/memory/qgsmemoryproviderutils.sip
290+
289291
%Include raster/qgsbilinearrasterresampler.sip
290292
%Include raster/qgsbrightnesscontrastfilter.sip
291293
%Include raster/qgscliptominmaxenhancement.sip
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/providers/memory/qgsmemoryproviderutils.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
class QgsMemoryProviderUtils
14+
{
15+
%Docstring
16+
Utility functions for use with the memory vector data provider.
17+
.. versionadded:: 3.0
18+
%End
19+
20+
%TypeHeaderCode
21+
#include "qgsmemoryproviderutils.h"
22+
%End
23+
public:
24+
25+
static QgsVectorLayer *createMemoryLayer( const QString &name,
26+
const QgsFields &fields,
27+
QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry,
28+
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() ) /Factory/;
29+
%Docstring
30+
Creates a new memory layer using the specified parameters. The caller takes responsibility
31+
for deleting the newly created layer.
32+
\param name layer name
33+
\param fields fields for layer
34+
\param geometryType optional layer geometry type
35+
\param crs optional layer CRS for layers with geometry
36+
:rtype: QgsVectorLayer
37+
%End
38+
};
39+
40+
41+
42+
/************************************************************************
43+
* This file has been generated automatically from *
44+
* *
45+
* src/core/providers/memory/qgsmemoryproviderutils.h *
46+
* *
47+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
48+
************************************************************************/

python/core/qgsprovidermetadata.sip

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,75 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsprovidermetadata.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111

2-
/** \ingroup core
3-
* Holds data provider key, description, and associated shared library file information.
412

5-
The metadata class is used in a lazy load implementation in
6-
QgsProviderRegistry. To save memory, data providers are only actually
7-
loaded via QLibrary calls if they're to be used. (Though they're all
8-
iteratively loaded once to get their metadata information, and then
9-
unloaded when the QgsProviderRegistry is created.) QgsProviderMetadata
10-
supplies enough information to be able to later load the associated shared
11-
library object.
1213

13-
*/
1414
class QgsProviderMetadata
1515
{
16-
%TypeHeaderCode
17-
#include <qgsprovidermetadata.h>
16+
%Docstring
17+
Holds data provider key, description, and associated shared library file or function pointer information.
18+
19+
Provider metadata refers either to providers which are loaded via libraries or
20+
which are native providers that are included in the core QGIS installation
21+
and accessed through function pointers.
22+
23+
For library based providers, the metadata class is used in a lazy load
24+
implementation in QgsProviderRegistry. To save memory, data providers
25+
are only actually loaded via QLibrary calls if they're to be used. (Though they're all
26+
iteratively loaded once to get their metadata information, and then
27+
unloaded when the QgsProviderRegistry is created.) QgsProviderMetadata
28+
supplies enough information to be able to later load the associated shared
29+
library object.
1830
%End
1931

32+
%TypeHeaderCode
33+
#include "qgsprovidermetadata.h"
34+
%End
2035
public:
2136

37+
2238
QgsProviderMetadata( const QString &_key, const QString &_description, const QString &_library );
2339

24-
/** This returns the unique key associated with the provider
2540

26-
This key string is used for the associative container in QgsProviderRegistry
27-
*/
2841
QString key() const;
42+
%Docstring
43+
This returns the unique key associated with the provider
2944

30-
/** This returns descriptive text for the provider
45+
This key string is used for the associative container in QgsProviderRegistry
46+
:rtype: str
47+
%End
3148

32-
This is used to provide a descriptive list of available data providers.
33-
*/
3449
QString description() const;
50+
%Docstring
51+
This returns descriptive text for the provider
3552

36-
/** This returns the library file name
53+
This is used to provide a descriptive list of available data providers.
54+
:rtype: str
55+
%End
3756

38-
This is used to QLibrary calls to load the data provider.
39-
*/
4057
QString library() const;
58+
%Docstring
59+
This returns the library file name
60+
61+
This is used to QLibrary calls to load the data provider.
62+
:rtype: str
63+
%End
64+
65+
66+
};
4167

4268

43-
}; // class QgsProviderMetadata
69+
/************************************************************************
70+
* This file has been generated automatically from *
71+
* *
72+
* src/core/qgsprovidermetadata.h *
73+
* *
74+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
75+
************************************************************************/

0 commit comments

Comments
 (0)