Index: python/core/qgsmaplayerregistry.sip =================================================================== --- python/core/qgsmaplayerregistry.sip (Revision 14696) +++ python/core/qgsmaplayerregistry.sip (Arbeitskopie) @@ -73,12 +73,18 @@ signals: - /** emitted when a layer is removed from the registry + /** emitted when a layer will be removed from the registry connected to main map canvas and overview map canvas remove() */ void layerWillBeRemoved(QString theLayerId); + /** emitted when a layer was removed from the registry + + connected to main map canvas and overview map canvas remove() + */ + void layerWasRemoved( ); + /** emitted when a layer is added to the registry connected to main map canvas and overview map canvas addLayer() Index: src/app/qgssnappingdialog.cpp =================================================================== --- src/app/qgssnappingdialog.cpp (Revision 14696) +++ src/app/qgssnappingdialog.cpp (Arbeitskopie) @@ -27,6 +27,7 @@ #include #include #include +#include class QgsSnappingDock : public QDockWidget @@ -63,9 +64,10 @@ else { connect( mButtonBox, SIGNAL( accepted() ), this, SLOT( apply() ) ); + connect( mButtonBox->button(QDialogButtonBox::Apply), SIGNAL( clicked() ), this, SLOT( apply() ) ); } connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasAdded( QgsMapLayer * ) ), this, SLOT( update() ) ); - connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( update() ) ); + connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasRemoved( ) ), this, SLOT( update() ) ); update(); @@ -133,9 +135,11 @@ mLayerTreeWidget->clear(); - for ( int i = 0; i < mMapCanvas->layerCount(); ++i ) + QMap< QString, QgsMapLayer *> mapLayers = QgsMapLayerRegistry::instance()->mapLayers(); + QMap< QString, QgsMapLayer *>::iterator it; + for ( it = mapLayers.begin(); it != mapLayers.end() ; ++it ) { - QgsVectorLayer *currentVectorLayer = qobject_cast( mMapCanvas->layer( i ) ); + QgsVectorLayer *currentVectorLayer = qobject_cast( it.value() ); if ( !currentVectorLayer ) continue; Index: src/app/qgsprojectproperties.h =================================================================== --- src/app/qgsprojectproperties.h (Revision 14696) +++ src/app/qgsprojectproperties.h (Arbeitskopie) @@ -21,7 +21,7 @@ #include "ui_qgsprojectpropertiesbase.h" #include "qgis.h" #include "qgisgui.h" -#include "qgssnappingdialog.h" +//#include "qgssnappingdialog.h" #include "qgscontexthelp.h" class QgsMapCanvas; Index: src/core/qgsmaplayerregistry.cpp =================================================================== --- src/core/qgsmaplayerregistry.cpp (Revision 14696) +++ src/core/qgsmaplayerregistry.cpp (Arbeitskopie) @@ -97,6 +97,8 @@ emit layerWillBeRemoved( theLayerId ); delete mMapLayers[theLayerId]; mMapLayers.remove( theLayerId ); + if ( theEmitSignal ) + emit layerWasRemoved( ); } void QgsMapLayerRegistry::removeAllMapLayers() @@ -111,6 +113,7 @@ { emit layerWillBeRemoved( it.key() ); delete it.value(); // delete the map layer + emit layerWasRemoved( ); } mMapLayers.clear(); Index: src/core/qgsmaplayerregistry.h =================================================================== --- src/core/qgsmaplayerregistry.h (Revision 14696) +++ src/core/qgsmaplayerregistry.h (Arbeitskopie) @@ -96,11 +96,16 @@ signals: - /** emitted when a layer is removed from the registry + /** emitted when a layer will be removed from the registry connected to main map canvas and overview map canvas remove() */ void layerWillBeRemoved( QString theLayerId ); + /** emitted when a layer was removed from the registry + connected to main map canvas and overview map canvas remove() + */ + void layerWasRemoved( ); + /** emitted when a layer is added to the registry connected to main map canvas and overview map canvas addLayer() */ Index: src/ui/qgssnappingdialogbase.ui =================================================================== --- src/ui/qgssnappingdialogbase.ui (Revision 14696) +++ src/ui/qgssnappingdialogbase.ui (Arbeitskopie) @@ -30,7 +30,7 @@ - + @@ -61,7 +61,7 @@ Qt::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok