Skip to content

Commit

Permalink
Fix sqlite errors when trying to save an updated custom projection th…
Browse files Browse the repository at this point in the history
…rough the custom projection dialog
  • Loading branch information
nyalldawson committed Dec 17, 2019
1 parent aa864dc commit 759ba8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -243,10 +243,11 @@ bool QgsCustomProjectionDialog::saveCrs( QgsCoordinateReferenceSystem parameters
{
sql = "update tbl_srs set description="
+ QgsSqliteUtils::quotedString( name )
+ ",projection_acronym=" + QgsSqliteUtils::quotedString( projectionAcronym )
+ ",ellipsoid_acronym=" + QgsSqliteUtils::quotedString( ellipsoidAcronym )
+ ",projection_acronym=" + ( !projectionAcronym.isEmpty() ? QgsSqliteUtils::quotedString( projectionAcronym ) : QStringLiteral( "''" ) )
+ ",ellipsoid_acronym=" + ( !ellipsoidAcronym.isEmpty() ? QgsSqliteUtils::quotedString( ellipsoidAcronym ) : QStringLiteral( "''" ) )
+ ",parameters=" + QgsSqliteUtils::quotedString( parameters.toProj4() )
+ ",is_geo=0" // <--shamelessly hard coded for now
+ ",wkt=" + QgsSqliteUtils::quotedString( parameters.toWkt() )
+ " where srs_id=" + QgsSqliteUtils::quotedString( id )
;
QgsDebugMsgLevel( sql, 4 );
Expand Down

0 comments on commit 759ba8d

Please sign in to comment.