You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QgsMessageLog::logMessage( tr( "[ERROR] Can not make qgis.db private copy" ) );
2142
-
return false;
2143
-
}
2144
-
}
2145
-
else
2146
-
{
2147
-
// migrate if necessary
2148
-
sqlite3 *db;
2149
-
if ( sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8().constData(), &db ) != SQLITE_OK )
2150
-
{
2151
-
QMessageBox::critical( this, tr( "Private qgis.db" ), tr( "Could not open qgis.db" ) );
2152
-
return false;
2153
-
}
2154
-
2155
-
char *errmsg;
2156
-
int res = sqlite3_exec( db, "SELECT epsg FROM tbl_srs LIMIT 0", 0, 0, &errmsg );
2157
-
if ( res == SQLITE_OK )
2158
-
{
2159
-
// epsg column exists => need migration
2160
-
if ( sqlite3_exec( db,
2161
-
"ALTER TABLE tbl_srs RENAME TO tbl_srs_bak;"
2162
-
"CREATE TABLE tbl_srs ("
2163
-
"srs_id INTEGER PRIMARY KEY,"
2164
-
"description text NOT NULL,"
2165
-
"projection_acronym text NOT NULL,"
2166
-
"ellipsoid_acronym NOT NULL,"
2167
-
"parameters text NOT NULL,"
2168
-
"srid integer,"
2169
-
"auth_name varchar,"
2170
-
"auth_id varchar,"
2171
-
"is_geo integer NOT NULL,"
2172
-
"deprecated boolean);"
2173
-
"CREATE INDEX idx_srsauthid on tbl_srs(auth_name,auth_id);"
2174
-
"INSERT INTO tbl_srs(srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) SELECT srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,'','',is_geo,0 FROM tbl_srs_bak;"
*errorMessage = tr( "[ERROR] Can not make qgis.db private copy" );
912
+
}
913
+
returnfalse;
914
+
}
915
+
}
916
+
else
917
+
{
918
+
// migrate if necessary
919
+
sqlite3 *db;
920
+
if ( sqlite3_open( QgsApplication::qgisUserDbFilePath().toUtf8().constData(), &db ) != SQLITE_OK )
921
+
{
922
+
if ( errorMessage )
923
+
{
924
+
*errorMessage = tr( "Could not open qgis.db" );
925
+
}
926
+
returnfalse;
927
+
}
928
+
929
+
char *errmsg;
930
+
int res = sqlite3_exec( db, "SELECT epsg FROM tbl_srs LIMIT 0", 0, 0, &errmsg );
931
+
if ( res == SQLITE_OK )
932
+
{
933
+
// epsg column exists => need migration
934
+
if ( sqlite3_exec( db,
935
+
"ALTER TABLE tbl_srs RENAME TO tbl_srs_bak;"
936
+
"CREATE TABLE tbl_srs ("
937
+
"srs_id INTEGER PRIMARY KEY,"
938
+
"description text NOT NULL,"
939
+
"projection_acronym text NOT NULL,"
940
+
"ellipsoid_acronym NOT NULL,"
941
+
"parameters text NOT NULL,"
942
+
"srid integer,"
943
+
"auth_name varchar,"
944
+
"auth_id varchar,"
945
+
"is_geo integer NOT NULL,"
946
+
"deprecated boolean);"
947
+
"CREATE INDEX idx_srsauthid on tbl_srs(auth_name,auth_id);"
948
+
"INSERT INTO tbl_srs(srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) SELECT srs_id,description,projection_acronym,ellipsoid_acronym,parameters,srid,'','',is_geo,0 FROM tbl_srs_bak;"
0 commit comments