Skip to content

Commit

Permalink
make QgsMapLayerRegistry ctor private (it's a singleton)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Aug 18, 2014
1 parent 4ade943 commit 621edef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions python/core/qgsmaplayerregistry.sip
Expand Up @@ -213,10 +213,8 @@ class QgsMapLayerRegistry : QObject
*/
void legendLayersAdded( QList<QgsMapLayer*> theMapLayers );

protected:
//! protected constructor
QgsMapLayerRegistry( QObject * parent = 0 );

private:
QgsMapLayerRegistry(); // private 'cause it's a singleton

void connectNotify( const char * signal );
}; // class QgsMapLayerRegistry
6 changes: 3 additions & 3 deletions src/core/qgsmaplayerregistry.h
Expand Up @@ -239,15 +239,15 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
void legendLayersAdded( QList<QgsMapLayer*> 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<QString, QgsMapLayer*> mMapLayers;
QSet<QgsMapLayer*> mOwnedLayers;
Expand Down

0 comments on commit 621edef

Please sign in to comment.