Skip to content

Commit

Permalink
add the registry to QgsApplication
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 19, 2020
1 parent b1920bb commit 75a991c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/core/auto_generated/qgsapplication.sip.in
Expand Up @@ -857,6 +857,13 @@ Gets the registry of available scalebar renderers.
Returns registry of available project storage implementations. Returns registry of available project storage implementations.


.. versionadded:: 3.2 .. versionadded:: 3.2
%End

static QgsBasemapPathRegistry *basemapPathRegistry() /KeepReference/;
%Docstring
Returns the registry of basemaps paths

.. versionadded:: 3.14
%End %End


static QString nullRepresentation(); static QString nullRepresentation();
Expand Down
8 changes: 8 additions & 0 deletions src/core/qgsapplication.cpp
Expand Up @@ -15,6 +15,7 @@


#include "qgsapplication.h" #include "qgsapplication.h"
#include "qgsauthmanager.h" #include "qgsauthmanager.h"
#include "qgsbasemappathregistry.h"
#include "qgsdataitemproviderregistry.h" #include "qgsdataitemproviderregistry.h"
#include "qgsexception.h" #include "qgsexception.h"
#include "qgsgeometry.h" #include "qgsgeometry.h"
Expand Down Expand Up @@ -2235,6 +2236,11 @@ QgsProjectStorageRegistry *QgsApplication::projectStorageRegistry()
return members()->mProjectStorageRegistry; return members()->mProjectStorageRegistry;
} }


QgsBasemapPathRegistry *QgsApplication::basemapPathRegistry()
{
return members()->mBasemapPathRegistry;
}

QgsApplication::ApplicationMembers::ApplicationMembers() QgsApplication::ApplicationMembers::ApplicationMembers()
{ {
// don't use initializer lists or scoped pointers - as more objects are added here we // don't use initializer lists or scoped pointers - as more objects are added here we
Expand Down Expand Up @@ -2369,6 +2375,7 @@ QgsApplication::ApplicationMembers::ApplicationMembers()
mScaleBarRendererRegistry = new QgsScaleBarRendererRegistry(); mScaleBarRendererRegistry = new QgsScaleBarRendererRegistry();
mProfiler->end(); mProfiler->end();
} }
mBasemapPathRegistry = new QgsBasemapPathRegistry();
} }


QgsApplication::ApplicationMembers::~ApplicationMembers() QgsApplication::ApplicationMembers::~ApplicationMembers()
Expand Down Expand Up @@ -2402,6 +2409,7 @@ QgsApplication::ApplicationMembers::~ApplicationMembers()
delete mNumericFormatRegistry; delete mNumericFormatRegistry;
delete mBookmarkManager; delete mBookmarkManager;
delete mConnectionRegistry; delete mConnectionRegistry;
delete mBasemapPathRegistry;
} }


QgsApplication::ApplicationMembers *QgsApplication::members() QgsApplication::ApplicationMembers *QgsApplication::members()
Expand Down
8 changes: 8 additions & 0 deletions src/core/qgsapplication.h
Expand Up @@ -32,6 +32,7 @@ class QgsFieldFormatterRegistry;
class QgsColorSchemeRegistry; class QgsColorSchemeRegistry;
class QgsPaintEffectRegistry; class QgsPaintEffectRegistry;
class QgsProjectStorageRegistry; class QgsProjectStorageRegistry;
class QgsBasemapPathRegistry;
class QgsRendererRegistry; class QgsRendererRegistry;
class QgsSvgCache; class QgsSvgCache;
class QgsImageCache; class QgsImageCache;
Expand Down Expand Up @@ -789,6 +790,12 @@ class CORE_EXPORT QgsApplication : public QApplication
*/ */
static QgsProjectStorageRegistry *projectStorageRegistry() SIP_KEEPREFERENCE; static QgsProjectStorageRegistry *projectStorageRegistry() SIP_KEEPREFERENCE;


/**
* Returns the registry of basemaps paths
* \since QGIS 3.14
*/
static QgsBasemapPathRegistry *basemapPathRegistry() SIP_KEEPREFERENCE;

/** /**
* This string is used to represent the value `NULL` throughout QGIS. * This string is used to represent the value `NULL` throughout QGIS.
* *
Expand Down Expand Up @@ -913,6 +920,7 @@ class CORE_EXPORT QgsApplication : public QApplication
QgsActionScopeRegistry *mActionScopeRegistry = nullptr; QgsActionScopeRegistry *mActionScopeRegistry = nullptr;
QgsAnnotationRegistry *mAnnotationRegistry = nullptr; QgsAnnotationRegistry *mAnnotationRegistry = nullptr;
QgsColorSchemeRegistry *mColorSchemeRegistry = nullptr; QgsColorSchemeRegistry *mColorSchemeRegistry = nullptr;
QgsBasemapPathRegistry *mBasemapPathRegistry = nullptr;
QgsNumericFormatRegistry *mNumericFormatRegistry = nullptr; QgsNumericFormatRegistry *mNumericFormatRegistry = nullptr;
QgsFieldFormatterRegistry *mFieldFormatterRegistry = nullptr; QgsFieldFormatterRegistry *mFieldFormatterRegistry = nullptr;
QgsGpsConnectionRegistry *mGpsConnectionRegistry = nullptr; QgsGpsConnectionRegistry *mGpsConnectionRegistry = nullptr;
Expand Down

0 comments on commit 75a991c

Please sign in to comment.