diff --git a/src/core/qgscoordinatereferencesystem.cpp b/src/core/qgscoordinatereferencesystem.cpp index 2b5a971b7ad9..a32f01038859 100644 --- a/src/core/qgscoordinatereferencesystem.cpp +++ b/src/core/qgscoordinatereferencesystem.cpp @@ -314,13 +314,6 @@ bool QgsCoordinateReferenceSystem::createFromString( const QString &definition ) if ( match.captured( 1 ).compare( QLatin1String( "proj4" ), Qt::CaseInsensitive ) == 0 ) { result = createFromProj( match.captured( 2 ) ); - if ( srsid() == 0 ) - { - QString myName = QStringLiteral( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), - toProj() ); - saveAsUserCrs( myName ); - } } else { @@ -766,13 +759,6 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &wkt ) else { setWktString( wkt ); - if ( d->mSrsId == 0 ) - { - QString myName = QStringLiteral( " * %1 (%2...)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), - wkt.left( 50 ) ); - saveAsUserCrs( myName ); - } } locker.changeMode( QgsReadWriteLocker::Write ); @@ -1950,14 +1936,6 @@ bool QgsCoordinateReferenceSystem::readXml( const QDomNode &node ) //make sure the map units have been set setMapUnits(); } - - if ( isValid() && d->mSrsId == 0 ) - { - QString myName = QStringLiteral( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), - toProj() ); - saveAsUserCrs( myName ); - } } else { diff --git a/src/providers/spatialite/qgsspatialiteprovider.cpp b/src/providers/spatialite/qgsspatialiteprovider.cpp index f0b3dca65041..e91058ce10a4 100644 --- a/src/providers/spatialite/qgsspatialiteprovider.cpp +++ b/src/providers/spatialite/qgsspatialiteprovider.cpp @@ -3609,29 +3609,15 @@ QgsCoordinateReferenceSystem QgsSpatiaLiteProvider::crs() const if ( !srs.isValid() ) { srs = QgsCoordinateReferenceSystem::fromProj( mProj4text ); - //TODO: createFromProj4 used to save to the user database any new CRS - // this behavior was changed in order to separate creation and saving. - // Not sure if it necessary to save it here, should be checked by someone - // familiar with the code (should also give a more descriptive name to the generated CRS) - if ( srs.srsid() == 0 ) - { - QString myName = QStringLiteral( " * %1 (%2)" ) - .arg( QObject::tr( "Generated CRS", "A CRS automatically generated from layer info get this prefix for description" ), - srs.toProj() ); - srs.saveAsUserCrs( myName ); - } - } return srs; } - bool QgsSpatiaLiteProvider::isValid() const { return mValid; } - QString QgsSpatiaLiteProvider::name() const { return SPATIALITE_KEY;