From 621edef24eb2bf4312f9e8e5766eb45a0ec3005f Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Mon, 18 Aug 2014 11:47:08 +0200 Subject: [PATCH] make QgsMapLayerRegistry ctor private (it's a singleton) --- python/core/qgsmaplayerregistry.sip | 6 ++---- src/core/qgsmaplayerregistry.h | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/python/core/qgsmaplayerregistry.sip b/python/core/qgsmaplayerregistry.sip index 2710cd27e7a..50bdb83fffe 100644 --- a/python/core/qgsmaplayerregistry.sip +++ b/python/core/qgsmaplayerregistry.sip @@ -213,10 +213,8 @@ class QgsMapLayerRegistry : QObject */ void legendLayersAdded( QList theMapLayers ); - protected: - //! protected constructor - QgsMapLayerRegistry( QObject * parent = 0 ); - private: + QgsMapLayerRegistry(); // private 'cause it's a singleton + void connectNotify( const char * signal ); }; // class QgsMapLayerRegistry diff --git a/src/core/qgsmaplayerregistry.h b/src/core/qgsmaplayerregistry.h index d6e8938b2e2..814885d7857 100644 --- a/src/core/qgsmaplayerregistry.h +++ b/src/core/qgsmaplayerregistry.h @@ -239,15 +239,15 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject void legendLayersAdded( QList theMapLayers ); protected: - //! protected constructor - QgsMapLayerRegistry( QObject * parent = 0 ); - /** debugging member invoked when a connect() is made to this object */ void connectNotify( const char * signal ); private: + //! private singleton constructor + QgsMapLayerRegistry( QObject * parent = 0 ); + static QgsMapLayerRegistry *mInstance; QMap mMapLayers; QSet mOwnedLayers;