@@ -59,6 +59,7 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl, bool ma
59
59
, mManagerMode( managerMode )
60
60
, mEmbeddedMode( embeddedMode )
61
61
, mCurrentTileset( 0 )
62
+ , mDefaultCRS( GEO_EPSG_CRS_AUTHID )
62
63
{
63
64
setupUi ( this );
64
65
@@ -117,7 +118,7 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl, bool ma
117
118
QgsCoordinateReferenceSystem currentRefSys ( currentCRS, QgsCoordinateReferenceSystem::InternalCrsId );
118
119
if ( currentRefSys.isValid () )
119
120
{
120
- mCRS = currentRefSys.authid ();
121
+ mDefaultCRS = mCRS = currentRefSys.authid ();
121
122
}
122
123
}
123
124
@@ -409,6 +410,8 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
409
410
lstLayers->expandItem ( lstLayers->topLevelItem ( 0 ) );
410
411
}
411
412
413
+ on_lstLayers_itemSelectionChanged ();
414
+
412
415
return true ;
413
416
}
414
417
@@ -741,7 +744,6 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged()
741
744
mCurrentSelection = lstLayers->selectedItems ();
742
745
lstLayers->blockSignals ( false );
743
746
744
-
745
747
// selected layers with styles
746
748
QStringList layers;
747
749
QStringList styles;
@@ -801,7 +803,7 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged()
801
803
defaultCRS = *it;
802
804
803
805
// prefer value of DEFAULT_GEO_EPSG_CRS_ID if available
804
- if ( *it == GEO_EPSG_CRS_AUTHID )
806
+ if ( *it == mDefaultCRS )
805
807
defaultCRS = *it;
806
808
}
807
809
@@ -813,7 +815,7 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged()
813
815
}
814
816
815
817
}
816
- else if ( mCRSs .isEmpty () )
818
+ else if ( layers. isEmpty () || mCRSs .isEmpty () )
817
819
{
818
820
mCRS = " " ;
819
821
labelCoordRefSys->setText ( " " );
0 commit comments