Skip to content
Permalink
Browse files

Open sqlite db for datum transform info in readonly mode. Fixes slow …

…opening on windows
  • Loading branch information
mhugent committed Jan 4, 2016
1 parent 94da2ab commit de0a88682d2aca30a63b25a57c06f590a9af7aed
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgscoordinatetransform.cpp
@@ -904,7 +904,7 @@ QString QgsCoordinateTransform::stripDatumTransform( const QString& proj4 )
void QgsCoordinateTransform::searchDatumTransform( const QString& sql, QList< int >& transforms )
{
sqlite3* db;
int openResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().constData(), &db );
int openResult = sqlite3_open_v2( QgsApplication::srsDbFilePath().toUtf8().constData(), &db, SQLITE_OPEN_READONLY, 0 );
if ( openResult != SQLITE_OK )
{
sqlite3_close( db );
@@ -935,7 +935,7 @@ QString QgsCoordinateTransform::datumTransformString( int datumTransform )
QString transformString;

sqlite3* db;
int openResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().constData(), &db );
int openResult = sqlite3_open_v2( QgsApplication::srsDbFilePath().toUtf8().constData(), &db, SQLITE_OPEN_READONLY, 0 );
if ( openResult != SQLITE_OK )
{
sqlite3_close( db );
@@ -989,7 +989,7 @@ QString QgsCoordinateTransform::datumTransformString( int datumTransform )
bool QgsCoordinateTransform::datumTransformCrsInfo( int datumTransform, int& epsgNr, QString& srcProjection, QString& dstProjection, QString &remarks, QString &scope, bool &preferred, bool &deprecated )
{
sqlite3* db;
int openResult = sqlite3_open( QgsApplication::srsDbFilePath().toUtf8().constData(), &db );
int openResult = sqlite3_open_v2( QgsApplication::srsDbFilePath().toUtf8().constData(), &db, SQLITE_OPEN_READONLY, 0 );
if ( openResult != SQLITE_OK )
{
sqlite3_close( db );

0 comments on commit de0a886

Please sign in to comment.
You can’t perform that action at this time.