@@ -245,21 +245,21 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
245
245
if ( parts.size () < 2 )
246
246
continue ;
247
247
248
- authParts[ parts.at ( 0 )].append ( parts.at ( 1 ) );
248
+ authParts[ parts.at ( 0 ). toUpper () ].append ( parts.at ( 1 ). toUpper ( ) );
249
249
}
250
250
251
251
if ( authParts.isEmpty () )
252
252
return sqlExpression;
253
253
254
- if ( authParts.size () > 0 )
254
+ if ( authParts.size () > 0 )
255
255
{
256
256
QString prefix = " AND (" ;
257
257
foreach ( QString auth_name, authParts.keys () )
258
258
{
259
- sqlExpression += QString ( " %1(lower (auth_name)=lower( '%2') AND auth_id IN ('%3'))" )
260
- .arg ( prefix )
261
- .arg ( auth_name )
262
- .arg ( authParts[auth_name].join ( " ','" ) );
259
+ sqlExpression += QString ( " %1(upper (auth_name)='%2' AND upper( auth_id) IN ('%3'))" )
260
+ .arg ( prefix )
261
+ .arg ( auth_name )
262
+ .arg ( authParts[auth_name].join ( " ','" ) );
263
263
prefix = " OR " ;
264
264
}
265
265
sqlExpression += " )" ;
@@ -620,7 +620,7 @@ long QgsProjectionSelector::selectedPostgresSrId()
620
620
621
621
QString QgsProjectionSelector::selectedAuthId ()
622
622
{
623
- return getSelectedExpression ( " auth_name||':'||auth_id" );
623
+ return getSelectedExpression ( " upper( auth_name||':'||auth_id) " );
624
624
}
625
625
626
626
@@ -788,7 +788,7 @@ void QgsProjectionSelector::loadCrsList( QSet<QString> * crsFilter )
788
788
// Set up the query to retrieve the projection information needed to populate the list
789
789
// note I am giving the full field names for clarity here and in case someone
790
790
// changes the underlying view TS
791
- sql = QString ( " select description, srs_id, auth_name||':'||auth_id, is_geo, name, parameters, deprecated from vw_srs where %1 order by name,description" )
791
+ sql = QString ( " select description, srs_id, upper( auth_name||':'||auth_id) , is_geo, name, parameters, deprecated from vw_srs where %1 order by name,description" )
792
792
.arg ( sqlFilter );
793
793
794
794
rc = sqlite3_prepare ( db, sql.toUtf8 (), sql.toUtf8 ().length (), &ppStmt, &pzTail );
@@ -897,24 +897,24 @@ void QgsProjectionSelector::coordinateSystemSelected( QTreeWidgetItem * theItem
897
897
898
898
void QgsProjectionSelector::hideDeprecated ( QTreeWidgetItem *item )
899
899
{
900
- if ( item->data ( 0 , Qt::UserRole ).toBool () )
900
+ if ( item->data ( 0 , Qt::UserRole ).toBool () )
901
901
{
902
902
item->setHidden ( cbxHideDeprecated->isChecked () );
903
- if ( item->isSelected () && item->isHidden () )
903
+ if ( item->isSelected () && item->isHidden () )
904
904
{
905
905
teProjection->setText ( " " );
906
906
item->setSelected ( false );
907
907
}
908
908
}
909
909
910
- for ( int i= 0 ; i < item->childCount (); i++ )
911
- hideDeprecated ( item->child (i ) );
910
+ for ( int i = 0 ; i < item->childCount (); i++ )
911
+ hideDeprecated ( item->child ( i ) );
912
912
}
913
913
914
914
void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged ()
915
915
{
916
- for ( int i = 0 ; i< lstCoordinateSystems->topLevelItemCount (); i++ )
917
- hideDeprecated ( lstCoordinateSystems->topLevelItem (i ) );
916
+ for ( int i = 0 ; i < lstCoordinateSystems->topLevelItemCount (); i++ )
917
+ hideDeprecated ( lstCoordinateSystems->topLevelItem ( i ) );
918
918
}
919
919
920
920
void QgsProjectionSelector::on_pbnPopular1_clicked ()
@@ -946,14 +946,14 @@ void QgsProjectionSelector::on_pbnFind_clicked()
946
946
QString mySql;
947
947
if ( radAuthId->isChecked () )
948
948
{
949
- mySql = QString ( " select srs_id from tbl_srs where auth_name||':'||auth_id='%1'" ).arg ( mySearchString );
949
+ mySql = QString ( " select srs_id from tbl_srs where upper( auth_name||':'||auth_id) ='%1'" ).arg ( mySearchString. toUpper () );
950
950
}
951
951
else if ( radName->isChecked () ) // name search
952
952
{
953
953
// we need to find what the largest srsid matching our query so we know whether to
954
954
// loop backto the beginning
955
- mySql = " select srs_id from tbl_srs where description like '%" + mySearchString + " %'" ;
956
- if ( cbxHideDeprecated->isChecked () )
955
+ mySql = " select srs_id from tbl_srs where upper( description) like '%" + mySearchString. toUpper () + " %'" ;
956
+ if ( cbxHideDeprecated->isChecked () )
957
957
mySql += " and not deprecated" ;
958
958
mySql += " order by srs_id desc limit 1" ;
959
959
long myLargestSrsId = getLargestCRSIDMatch ( mySql );
@@ -963,16 +963,16 @@ void QgsProjectionSelector::on_pbnFind_clicked()
963
963
if ( myLargestSrsId <= selectedCrsId () )
964
964
{
965
965
// roll search around to the beginning
966
- mySql = " select srs_id from tbl_srs where description like '%" + mySearchString + " %'" ;
967
- if ( cbxHideDeprecated->isChecked () )
966
+ mySql = " select srs_id from tbl_srs where upper( description) like '%" + mySearchString. toUpper () + " %'" ;
967
+ if ( cbxHideDeprecated->isChecked () )
968
968
mySql += " and not deprecated" ;
969
969
mySql += " order by srs_id limit 1" ;
970
970
}
971
971
else
972
972
{
973
973
// search ahead of the current position
974
- mySql = " select srs_id from tbl_srs where description like '%" + mySearchString + " %'" ;
975
- if ( cbxHideDeprecated->isChecked () )
974
+ mySql = " select srs_id from tbl_srs where upper( description) like '%" + mySearchString. toUpper () + " %'" ;
975
+ if ( cbxHideDeprecated->isChecked () )
976
976
mySql += " and not deprecated" ;
977
977
mySql += " and srs_id > " + QString::number ( selectedCrsId () ) + " order by srs_id limit 1" ;
978
978
}
0 commit comments