Skip to content

Commit

Permalink
open CRS database readonly by default (fixes permission timeouts on w…
Browse files Browse the repository at this point in the history
…indows)
  • Loading branch information
jef-n committed Apr 2, 2012
1 parent 5101155 commit 9154e4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -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 )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgscoordinatereferencesystem.h
Expand Up @@ -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;
Expand Down

0 comments on commit 9154e4e

Please sign in to comment.