Skip to content

Commit 621edef

Browse files
committed
make QgsMapLayerRegistry ctor private (it's a singleton)
1 parent 4ade943 commit 621edef

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

python/core/qgsmaplayerregistry.sip

+2-4
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,8 @@ class QgsMapLayerRegistry : QObject
213213
*/
214214
void legendLayersAdded( QList<QgsMapLayer*> theMapLayers );
215215

216-
protected:
217-
//! protected constructor
218-
QgsMapLayerRegistry( QObject * parent = 0 );
219-
220216
private:
217+
QgsMapLayerRegistry(); // private 'cause it's a singleton
218+
221219
void connectNotify( const char * signal );
222220
}; // class QgsMapLayerRegistry

src/core/qgsmaplayerregistry.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
239239
void legendLayersAdded( QList<QgsMapLayer*> theMapLayers );
240240

241241
protected:
242-
//! protected constructor
243-
QgsMapLayerRegistry( QObject * parent = 0 );
244-
245242
/** debugging member
246243
invoked when a connect() is made to this object
247244
*/
248245
void connectNotify( const char * signal );
249246

250247
private:
248+
//! private singleton constructor
249+
QgsMapLayerRegistry( QObject * parent = 0 );
250+
251251
static QgsMapLayerRegistry *mInstance;
252252
QMap<QString, QgsMapLayer*> mMapLayers;
253253
QSet<QgsMapLayer*> mOwnedLayers;

0 commit comments

Comments
 (0)