@@ -144,7 +144,7 @@ QgsSnappingLayerTreeModel::QgsSnappingLayerTreeModel( QgsProject* project, QObje
144144 , mLayerTreeModel( nullptr )
145145{
146146 connect ( project, &QgsProject::snappingConfigChanged, this , &QgsSnappingLayerTreeModel::onSnappingSettingsChanged );
147- connect ( project, &QgsProject::avoidIntersectionsListChanged , this , &QgsSnappingLayerTreeModel::onSnappingSettingsChanged );
147+ connect ( project, &QgsProject::avoidIntersectionsLayersChanged , this , &QgsSnappingLayerTreeModel::onSnappingSettingsChanged );
148148}
149149
150150QgsSnappingLayerTreeModel::~QgsSnappingLayerTreeModel ()
@@ -494,7 +494,7 @@ QVariant QgsSnappingLayerTreeModel::data( const QModelIndex& idx, int role ) con
494494 {
495495 if ( role == Qt::CheckStateRole && vl->geometryType () == QgsWkbTypes::PolygonGeometry )
496496 {
497- if ( mProject ->avoidIntersectionsList ().contains ( vl-> id () ) )
497+ if ( mProject ->avoidIntersectionsLayers ().contains ( vl ) )
498498 {
499499 return Qt::Checked;
500500 }
@@ -620,14 +620,14 @@ bool QgsSnappingLayerTreeModel::setData( const QModelIndex& index, const QVarian
620620 if ( !mIndividualLayerSettings .contains ( vl ) )
621621 return false ;
622622
623- QStringList avoidIntersectionsList = mProject ->avoidIntersectionsList ();
623+ QList<QgsVectorLayer*> avoidIntersectionsList = mProject ->avoidIntersectionsLayers ();
624624
625- if ( value.toInt () == Qt::Checked && !avoidIntersectionsList.contains ( vl-> id () ) )
626- avoidIntersectionsList.append ( vl-> id () );
625+ if ( value.toInt () == Qt::Checked && !avoidIntersectionsList.contains ( vl ) )
626+ avoidIntersectionsList.append ( vl );
627627 else
628- avoidIntersectionsList.removeAll ( vl-> id () );
628+ avoidIntersectionsList.removeAll ( vl );
629629
630- mProject ->setAvoidIntersectionsList ( avoidIntersectionsList );
630+ mProject ->setAvoidIntersectionsLayers ( avoidIntersectionsList );
631631 return true ;
632632 }
633633 }
0 commit comments