Skip to content

Commit 75a991c

Browse files
committedMay 19, 2020
add the registry to QgsApplication
1 parent b1920bb commit 75a991c

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
 

‎python/core/auto_generated/qgsapplication.sip.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,13 @@ Gets the registry of available scalebar renderers.
857857
Returns registry of available project storage implementations.
858858

859859
.. versionadded:: 3.2
860+
%End
861+
862+
static QgsBasemapPathRegistry *basemapPathRegistry() /KeepReference/;
863+
%Docstring
864+
Returns the registry of basemaps paths
865+
866+
.. versionadded:: 3.14
860867
%End
861868

862869
static QString nullRepresentation();

‎src/core/qgsapplication.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "qgsapplication.h"
1717
#include "qgsauthmanager.h"
18+
#include "qgsbasemappathregistry.h"
1819
#include "qgsdataitemproviderregistry.h"
1920
#include "qgsexception.h"
2021
#include "qgsgeometry.h"
@@ -2235,6 +2236,11 @@ QgsProjectStorageRegistry *QgsApplication::projectStorageRegistry()
22352236
return members()->mProjectStorageRegistry;
22362237
}
22372238

2239+
QgsBasemapPathRegistry *QgsApplication::basemapPathRegistry()
2240+
{
2241+
return members()->mBasemapPathRegistry;
2242+
}
2243+
22382244
QgsApplication::ApplicationMembers::ApplicationMembers()
22392245
{
22402246
// don't use initializer lists or scoped pointers - as more objects are added here we
@@ -2369,6 +2375,7 @@ QgsApplication::ApplicationMembers::ApplicationMembers()
23692375
mScaleBarRendererRegistry = new QgsScaleBarRendererRegistry();
23702376
mProfiler->end();
23712377
}
2378+
mBasemapPathRegistry = new QgsBasemapPathRegistry();
23722379
}
23732380

23742381
QgsApplication::ApplicationMembers::~ApplicationMembers()
@@ -2402,6 +2409,7 @@ QgsApplication::ApplicationMembers::~ApplicationMembers()
24022409
delete mNumericFormatRegistry;
24032410
delete mBookmarkManager;
24042411
delete mConnectionRegistry;
2412+
delete mBasemapPathRegistry;
24052413
}
24062414

24072415
QgsApplication::ApplicationMembers *QgsApplication::members()

‎src/core/qgsapplication.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class QgsFieldFormatterRegistry;
3232
class QgsColorSchemeRegistry;
3333
class QgsPaintEffectRegistry;
3434
class QgsProjectStorageRegistry;
35+
class QgsBasemapPathRegistry;
3536
class QgsRendererRegistry;
3637
class QgsSvgCache;
3738
class QgsImageCache;
@@ -789,6 +790,12 @@ class CORE_EXPORT QgsApplication : public QApplication
789790
*/
790791
static QgsProjectStorageRegistry *projectStorageRegistry() SIP_KEEPREFERENCE;
791792

793+
/**
794+
* Returns the registry of basemaps paths
795+
* \since QGIS 3.14
796+
*/
797+
static QgsBasemapPathRegistry *basemapPathRegistry() SIP_KEEPREFERENCE;
798+
792799
/**
793800
* This string is used to represent the value `NULL` throughout QGIS.
794801
*
@@ -913,6 +920,7 @@ class CORE_EXPORT QgsApplication : public QApplication
913920
QgsActionScopeRegistry *mActionScopeRegistry = nullptr;
914921
QgsAnnotationRegistry *mAnnotationRegistry = nullptr;
915922
QgsColorSchemeRegistry *mColorSchemeRegistry = nullptr;
923+
QgsBasemapPathRegistry *mBasemapPathRegistry = nullptr;
916924
QgsNumericFormatRegistry *mNumericFormatRegistry = nullptr;
917925
QgsFieldFormatterRegistry *mFieldFormatterRegistry = nullptr;
918926
QgsGpsConnectionRegistry *mGpsConnectionRegistry = nullptr;

0 commit comments

Comments
 (0)
Please sign in to comment.