Skip to content
Permalink
Browse files

Fix initial selection in project ellipsoid list is reset whenever the…

… dialog

is reopened

Refs #33358

(cherry picked from commit 2cc64f9)
  • Loading branch information
nyalldawson committed Dec 13, 2019
1 parent 3371b9c commit d1e53f136099d5d33d74d410bf672b8a53c0e665
Showing with 20 additions and 10 deletions.
  1. +20 −10 src/app/qgsprojectproperties.cpp
@@ -2447,23 +2447,33 @@ void QgsProjectProperties::projectionSelectorInitialized()
QgsDebugMsgLevel( QStringLiteral( "Setting up ellipsoid" ), 4 );

// Reading ellipsoid from settings
QStringList mySplitEllipsoid = QgsProject::instance()->ellipsoid().split( ':' );
const QString currentEllipsoid = QgsProject::instance()->ellipsoid();

int index = 0;
for ( int i = 0; i < mEllipsoidList.length(); i++ )
if ( currentEllipsoid.startsWith( QLatin1String( "PARAMETER" ) ) )
{
if ( mEllipsoidList.at( i ).acronym.startsWith( mySplitEllipsoid[ 0 ] ) )
// Update parameters if present.
const QStringList mySplitEllipsoid = QgsProject::instance()->ellipsoid().split( ':' );
for ( int i = 0; i < mEllipsoidList.length(); i++ )
{
index = i;
break;
if ( mEllipsoidList.at( i ).acronym.startsWith( QLatin1String( "PARAMETER" ), Qt::CaseInsensitive ) )
{
index = i;
mEllipsoidList[ index ].semiMajor = mySplitEllipsoid[ 1 ].toDouble();
mEllipsoidList[ index ].semiMinor = mySplitEllipsoid[ 2 ].toDouble();
}
}
}

// Update parameters if present.
if ( mySplitEllipsoid.length() >= 3 )
else
{
mEllipsoidList[ index ].semiMajor = mySplitEllipsoid[ 1 ].toDouble();
mEllipsoidList[ index ].semiMinor = mySplitEllipsoid[ 2 ].toDouble();
for ( int i = 0; i < mEllipsoidList.length(); i++ )
{
if ( mEllipsoidList.at( i ).acronym.compare( currentEllipsoid, Qt::CaseInsensitive ) == 0 )
{
index = i;
break;
}
}
}

updateEllipsoidUI( index );

0 comments on commit d1e53f1

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