Skip to content

Commit f33c490

Browse files
committedJan 16, 2014
signal hasCrsTransformEnabled() renamed to hasCrsTransformEnabledChanged()
1 parent 8b6d180 commit f33c490

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed
 

‎python/core/qgsmaprenderer.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ class QgsMapRenderer : QObject
269269
void drawingProgress( int current, int total );
270270

271271
void hasCrsTransformEnabled( bool flag );
272+
void hasCrsTransformEnabledChanged( bool flag );
272273

273274
void destinationSrsChanged();
274275

‎python/gui/qgsmapcanvas.sip

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ class QgsMapCanvas : QGraphicsView
5757

5858
QgsMapCanvasMap* map();
5959

60-
QgsMapRenderer* mapRenderer() /Transfer/;
60+
// KeepReference is necessary because otherwise
61+
// mapRenderer().hasCrsTransformEnabled() was crashing, most probably because
62+
// QgsMapRenderer.hasCrsTransformEnabled() is both signal and function
63+
QgsMapRenderer* mapRenderer() /KeepReference/;
6164

6265
//! Accessor for the canvas paint device
6366
QPaintDevice &canvasPaintDevice();

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ void QgisApp::setupConnections()
19151915
// connect renderer
19161916
connect( mMapCanvas->mapRenderer(), SIGNAL( drawingProgress( int, int ) ),
19171917
this, SLOT( showProgress( int, int ) ) );
1918-
connect( mMapCanvas->mapRenderer(), SIGNAL( hasCrsTransformEnabled( bool ) ),
1918+
connect( mMapCanvas->mapRenderer(), SIGNAL( hasCrsTransformEnabledChanged( bool ) ),
19191919
this, SLOT( hasCrsTransformEnabled( bool ) ) );
19201920
connect( mMapCanvas->mapRenderer(), SIGNAL( destinationSrsChanged() ),
19211921
this, SLOT( destinationSrsChanged() ) );

‎src/core/qgsmaprenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,8 @@ void QgsMapRenderer::setProjectionsEnabled( bool enabled )
727727
mDistArea->setEllipsoidalMode( enabled );
728728
updateFullExtent();
729729
mLastExtent.setMinimal();
730-
emit hasCrsTransformEnabled( enabled );
730+
emit hasCrsTransformEnabled( enabled ); // deprecated
731+
emit hasCrsTransformEnabledChanged( enabled );
731732
}
732733
}
733734

‎src/core/qgsmaprenderer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,17 @@ class CORE_EXPORT QgsMapRenderer : public QObject
304304

305305
void drawingProgress( int current, int total );
306306

307+
/** This signal is emitted when CRS transformation is enabled/disabled.
308+
* @param flag true if transformation is enabled.
309+
* @deprecated Use hasCrsTransformEnabledChanged( bool flag )
310+
* to avoid conflict with method of the same name). */
307311
void hasCrsTransformEnabled( bool flag );
308312

313+
/** This signal is emitted when CRS transformation is enabled/disabled.
314+
* @param flag true if transformation is enabled.
315+
* @note Added in 2.1 */
316+
void hasCrsTransformEnabledChanged( bool flag );
317+
309318
void destinationSrsChanged();
310319

311320
void updateMap();

‎src/gui/qgsmapcanvas.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
124124
moveCanvasContents( true );
125125

126126
connect( mMapRenderer, SIGNAL( drawError( QgsMapLayer* ) ), this, SLOT( showError( QgsMapLayer* ) ) );
127-
connect( mMapRenderer, SIGNAL( hasCrsTransformEnabled( bool ) ), this, SLOT( crsTransformEnabled( bool ) ) );
127+
connect( mMapRenderer, SIGNAL( hasCrsTransformEnabledChanged( bool ) ), this, SLOT( crsTransformEnabled( bool ) ) );
128128

129129
crsTransformEnabled( hasCrsTransformEnabled() );
130130

@@ -338,7 +338,7 @@ void QgsMapCanvas::enableOverviewMode( QgsMapOverviewCanvas* overview )
338338
if ( mMapOverview )
339339
{
340340
// disconnect old map overview if exists
341-
disconnect( mMapRenderer, SIGNAL( hasCrsTransformEnabled( bool ) ),
341+
disconnect( mMapRenderer, SIGNAL( hasCrsTransformEnabledChanged( bool ) ),
342342
mMapOverview, SLOT( hasCrsTransformEnabled( bool ) ) );
343343
disconnect( mMapRenderer, SIGNAL( destinationSrsChanged() ),
344344
mMapOverview, SLOT( destinationSrsChanged() ) );
@@ -351,7 +351,7 @@ void QgsMapCanvas::enableOverviewMode( QgsMapOverviewCanvas* overview )
351351
if ( overview )
352352
{
353353
// connect to the map render to copy its projection settings
354-
connect( mMapRenderer, SIGNAL( hasCrsTransformEnabled( bool ) ),
354+
connect( mMapRenderer, SIGNAL( hasCrsTransformEnabledChanged( bool ) ),
355355
overview, SLOT( hasCrsTransformEnabled( bool ) ) );
356356
connect( mMapRenderer, SIGNAL( destinationSrsChanged() ),
357357
overview, SLOT( destinationSrsChanged() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.