Skip to content
Permalink
Browse files

do not transform project if current_version > transform.to (#7807)

* do nottransform project if current_version > transform.to
* use >=
  • Loading branch information
3nids committed Sep 6, 2018
1 parent 1839daa commit d6b2537e1e7a20e5a9ce028e3bbf1b94c9de852a
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/core/qgsprojectfiletransform.cpp
  2. +1 −1 src/core/qgsprojectfiletransform.h
@@ -65,7 +65,7 @@ QgsProjectFileTransform::TransformItem QgsProjectFileTransform::sTransformers[]
// A transformer with a NULL from version means that it should be run when upgrading
// from any version and will take care that it's not going to cause trouble if it's
// run several times on the same file.
{PFV(), PFV( 2, 99, 0 ), &QgsProjectFileTransform::transform2990},
{PFV(), PFV( 3, 0, 0 ), &QgsProjectFileTransform::transform3000},
};

bool QgsProjectFileTransform::updateRevision( const QgsProjectVersion &newVersion )
@@ -78,7 +78,7 @@ bool QgsProjectFileTransform::updateRevision( const QgsProjectVersion &newVersio
for ( std::size_t i = 0; i < sizeof( sTransformers ) / sizeof( TransformItem ); i++ )
{
const TransformItem &transformer = sTransformers[i];
if ( transformer.from == mCurrentVersion || transformer.from.isNull() )
if ( transformer.to >= mCurrentVersion && ( transformer.from == mCurrentVersion || transformer.from.isNull() ) )
{
// Run the transformer, and update the revision in every case
( this->*( transformer.transformFunc ) )();
@@ -621,7 +621,7 @@ void QgsProjectFileTransform::transform2200to2300()
}
}

void QgsProjectFileTransform::transform2990()
void QgsProjectFileTransform::transform3000()
{
// transform OTF off to "no projection" for project
QDomElement propsElem = mDom.firstChildElement( QStringLiteral( "qgis" ) ).toElement().firstChildElement( QStringLiteral( "properties" ) );
@@ -92,7 +92,7 @@ class CORE_EXPORT QgsProjectFileTransform
void transform1400to1500();
void transform1800to1900();
void transform2200to2300();
void transform2990();
void transform3000();

//helper functions
static int rasterBandNumber( const QDomElement &rasterPropertiesElem, const QString &bandName, QgsRasterLayer *rlayer );

0 comments on commit d6b2537

Please sign in to comment.
You can’t perform that action at this time.