Showing with 5 additions and 4 deletions.
  1. +3 −4 src/app/qgisapp.cpp
  2. +2 −0 src/app/qgsprojectproperties.cpp
7 changes: 3 additions & 4 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,9 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )
srs.createFromOgcWmsCrs( defCrs );
myRenderer->setDestinationCrs( srs );
// write the projections _proj string_ to project settings
prj->writeEntry( "SpatialRefSys", "/ProjectCrs", defCrs );
prj->writeEntry( "SpatialRefSys", "/ProjectCRSProj4String", srs.toProj4() );
prj->writeEntry( "SpatialRefSys", "/ProjectCrs", srs.authid() );
prj->writeEntry( "SpatialRefSys", "/ProjectCRSID", (int) srs.srsid() );
prj->dirty( false );
if ( srs.mapUnits() != QGis::UnknownUnit )
{
Expand Down Expand Up @@ -8086,9 +8088,6 @@ void QgisApp::updateCRSStatusBar()

void QgisApp::destinationSrsChanged()
{
// save this information to project
long srsid = mMapCanvas->mapRenderer()->destinationCrs().srsid();
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCRSID", ( int )srsid );
updateCRSStatusBar();
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ void QgsProjectProperties::apply()
// write the currently selected projections _proj string_ to project settings
QgsDebugMsg( QString( "SpatialRefSys/ProjectCRSProj4String: %1" ).arg( projectionSelector->selectedProj4String() ) );
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCRSProj4String", projectionSelector->selectedProj4String() );
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCRSID", (int) projectionSelector->selectedCrsId() );
QgsProject::instance()->writeEntry( "SpatialRefSys", "/ProjectCrs", projectionSelector->selectedAuthId() );

// Set the map units to the projected coordinates if we are projecting
if ( isProjected() )
Expand Down