fix projections selection when CRSes from multiple authorities are preselected

git-svn-id: http://svn.osgeo.org/qgis/trunk@13134 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2010-03-21 15:30:15 +00:00
parent 81fa1e2f5c
commit 1d056de0e5

View File

@ -251,10 +251,18 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
if ( authParts.isEmpty() )
return sqlExpression;
foreach( QString auth_name, authParts.keys() )
if( authParts.size() > 0 )
{
sqlExpression += QString( " AND (auth_name='%1' AND auth_id IN ('%2'))" )
.arg( auth_name ).arg( authParts[auth_name].join( "','" ) );
QString prefix = " AND (";
foreach( QString auth_name, authParts.keys() )
{
sqlExpression += QString( "%1(auth_name='%2' AND auth_id IN ('%3'))" )
.arg( prefix )
.arg( auth_name )
.arg( authParts[auth_name].join( "','" ) );
prefix = " OR ";
}
sqlExpression += ")";
}
QgsDebugMsg( "exiting with '" + sqlExpression + "'." );