Skip to content

Commit 92e67c8

Browse files
author
jef
committedDec 11, 2009
fix #2255
git-svn-id: http://svn.osgeo.org/qgis/trunk@12405 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 76ceea8 commit 92e67c8

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed
 

‎src/app/qgsidentifyresults.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,15 @@ void QgsIdentifyResults::addFeature( QgsMapLayer *layer, int fid,
159159
if ( vlayer )
160160
{
161161
connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
162+
connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
162163
connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
163164
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
164165
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
165166
}
166167
else
167168
{
168169
connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
170+
connect( layer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
169171
}
170172
}
171173

‎src/core/qgsmaplayer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,11 @@ const QgsCoordinateReferenceSystem& QgsMapLayer::srs()
440440
return *mCRS;
441441
}
442442

443-
void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs )
443+
void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal )
444444
{
445445
*mCRS = srs;
446+
if ( emitSignal )
447+
emit layerCrsChanged();
446448
}
447449

448450
unsigned int QgsMapLayer::getTransparency()

‎src/core/qgsmaplayer.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ class CORE_EXPORT QgsMapLayer : public QObject
211211
*/
212212
const QgsCoordinateReferenceSystem& srs();
213213

214-
/** Sets layer's spatial reference system */
215-
void setCrs( const QgsCoordinateReferenceSystem& srs );
214+
/** Sets layer's spatial reference system
215+
@note emitSignal added in 1.4 */
216+
void setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal = true );
216217

217218

218219
/** A convenience function to capitalise the layer name */
@@ -320,9 +321,14 @@ class CORE_EXPORT QgsMapLayer : public QObject
320321
/** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
321322
void statusChanged( QString theStatus );
322323

323-
/** Emit a signal that layer name has been changed */
324+
/** Emit a signal that the layer name has been changed */
324325
void layerNameChanged();
325326

327+
/** Emit a signal that layer's CRS has been reset
328+
added in 1.4
329+
*/
330+
void layerCrsChanged();
331+
326332
/** This signal should be connected with the slot QgsMapCanvas::refresh()
327333
* @TODO: to be removed - GUI dependency
328334
*/

0 commit comments

Comments
 (0)
Please sign in to comment.