Skip to content
Permalink
Browse files

Fix duplicate crsChanged signal emitted when loading projects

  • Loading branch information
nyalldawson committed Nov 13, 2017
1 parent f2b5a59 commit be8bad8e39ae41b691a9a0b2acef77a935736c23
Showing with 3 additions and 1 deletion.
  1. +0 −1 src/core/qgsproject.cpp
  2. +3 −0 tests/src/core/testqgscoordinatereferencesystem.cpp
@@ -909,7 +909,6 @@ bool QgsProject::readProjectFile( const QString &filename )
}
}
mCrs = projectCrs;
emit crsChanged();

QDomNodeList nl = doc->elementsByTagName( QStringLiteral( "autotransaction" ) );
if ( nl.count() )
@@ -27,6 +27,7 @@ Email : sherman at mrcc dot com
#include <proj_api.h>
#include <gdal.h>
#include <cpl_conv.h>
#include <QtTest/QSignalSpy>

class TestQgsCoordinateReferenceSystem: public QObject
{
@@ -840,9 +841,11 @@ void TestQgsCoordinateReferenceSystem::projectWithCustomCrs()
{
// tests loading a 2.x project with a custom CRS defined
QgsProject p;
QSignalSpy spyCrsChanged( &p, &QgsProject::crsChanged );
QVERIFY( p.read( TEST_DATA_DIR + QStringLiteral( "/projects/custom_crs.qgs" ) ) );
QVERIFY( p.crs().isValid() );
QCOMPARE( p.crs().toProj4(), QStringLiteral( "+proj=ortho +lat_0=42.1 +lon_0=12.8 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs" ) );
QCOMPARE( spyCrsChanged.count(), 1 );
}

QGSTEST_MAIN( TestQgsCoordinateReferenceSystem )

0 comments on commit be8bad8

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