mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-22 00:06:57 -04:00
open CRS database readonly by default (fixes permission timeouts on windows)
This commit is contained in:
parent
51011559c4
commit
9154e4e046
@ -1244,10 +1244,12 @@ QString QgsCoordinateReferenceSystem::proj4FromSrsId( const int theSrsId )
|
|||||||
return myProjString;
|
return myProjString;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QgsCoordinateReferenceSystem::openDb( QString path, sqlite3 **db )
|
int QgsCoordinateReferenceSystem::openDb( QString path, sqlite3 **db, bool readonly )
|
||||||
{
|
{
|
||||||
QgsDebugMsgLevel( "path = " + path, 3 );
|
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 )
|
if ( myResult != SQLITE_OK )
|
||||||
{
|
{
|
||||||
|
@ -398,9 +398,9 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
|
|||||||
*/
|
*/
|
||||||
RecordMap getRecord( QString theSql );
|
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
|
// 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
|
//!The internal sqlite3 srs.db primary key for this srs
|
||||||
long mSrsId;
|
long mSrsId;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user