Skip to content
Permalink
Browse files
open CRS database readonly by default (fixes permission timeouts on w…
…indows)
  • Loading branch information
jef-n committed Apr 2, 2012
1 parent 5101155 commit 9154e4e04685312a3b6988b1da7f9c28a7940e83
Showing with 6 additions and 4 deletions.
  1. +4 −2 src/core/qgscoordinatereferencesystem.cpp
  2. +2 −2 src/core/qgscoordinatereferencesystem.h
@@ -1244,10 +1244,12 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int theSrsId )
return myProjString;
}

int QgsCoordinateReferenceSystem::openDb( QString path, sqlite3 **db )
int QgsCoordinateReferenceSystem::openDb( QString path, sqlite3 **db, bool readonly )
{
QgsDebugMsgLevel( "path = " + path, 3 );
int myResult = sqlite3_open( path.toUtf8().data(), db );
int myResult = readonly
? sqlite3_open_v2( path.toUtf8().data(), db, SQLITE_OPEN_READONLY, NULL )
: sqlite3_open( path.toUtf8().data(), db );

if ( myResult != SQLITE_OK )
{
@@ -398,9 +398,9 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
*/
RecordMap getRecord( QString theSql );

// Open SQLite db and show message if ccannot be opened
// Open SQLite db and show message if cannot be opened
// returns the same code as sqlite3_open
static int openDb( QString path, sqlite3 **db );
static int openDb( QString path, sqlite3 **db, bool readonly = true );

//!The internal sqlite3 srs.db primary key for this srs
long mSrsId;

0 comments on commit 9154e4e

Please sign in to comment.