mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
only accept crs matches if there's only one (improved #5066)
This commit is contained in:
parent
31d1b95bdb
commit
42a9d01938
@ -694,8 +694,7 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
|
||||
QFileInfo myInfo( myDatabaseFileName );
|
||||
if ( !myInfo.exists() )
|
||||
{
|
||||
QgsDebugMsg( "failed : " + myDatabaseFileName +
|
||||
" does not exist!" );
|
||||
QgsDebugMsg( "failed : " + myDatabaseFileName + " does not exist!" );
|
||||
return myMap;
|
||||
}
|
||||
|
||||
@ -719,8 +718,18 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
|
||||
myFieldValue = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, myColNo ) );
|
||||
myMap[myFieldName] = myFieldValue;
|
||||
}
|
||||
if ( sqlite3_step( myPreparedStatement ) != SQLITE_DONE )
|
||||
{
|
||||
QgsDebugMsg( "Multiple records found in srs.db" );
|
||||
myMap.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "failed : " + theSql );
|
||||
}
|
||||
|
||||
if ( myMap.empty() )
|
||||
{
|
||||
QgsDebugMsg( "trying user qgis.db" );
|
||||
sqlite3_finalize( myPreparedStatement );
|
||||
@ -754,11 +763,16 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
|
||||
myFieldValue = QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, myColNo ) );
|
||||
myMap[myFieldName] = myFieldValue;
|
||||
}
|
||||
|
||||
if ( sqlite3_step( myPreparedStatement ) != SQLITE_DONE )
|
||||
{
|
||||
QgsDebugMsg( "Multiple records found in srs.db" );
|
||||
myMap.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "failed : " + theSql );
|
||||
|
||||
}
|
||||
}
|
||||
sqlite3_finalize( myPreparedStatement );
|
||||
|
Loading…
x
Reference in New Issue
Block a user