Skip to content

Commit

Permalink
fix #2255
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12405 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 11, 2009
1 parent 76ceea8 commit 92e67c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/app/qgsidentifyresults.cpp
Expand Up @@ -159,13 +159,15 @@ void QgsIdentifyResults::addFeature( QgsMapLayer *layer, int fid,
if ( vlayer )
{
connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
}
else
{
connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
connect( layer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/core/qgsmaplayer.cpp
Expand Up @@ -440,9 +440,11 @@ const QgsCoordinateReferenceSystem& QgsMapLayer::srs()
return *mCRS;
}

void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs )
void QgsMapLayer::setCrs( const QgsCoordinateReferenceSystem& srs, bool emitSignal )
{
*mCRS = srs;
if ( emitSignal )
emit layerCrsChanged();
}

unsigned int QgsMapLayer::getTransparency()
Expand Down
12 changes: 9 additions & 3 deletions src/core/qgsmaplayer.h
Expand Up @@ -211,8 +211,9 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
const QgsCoordinateReferenceSystem& srs();

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


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

/** Emit a signal that layer name has been changed */
/** Emit a signal that the layer name has been changed */
void layerNameChanged();

/** Emit a signal that layer's CRS has been reset
added in 1.4
*/
void layerCrsChanged();

/** This signal should be connected with the slot QgsMapCanvas::refresh()
* @TODO: to be removed - GUI dependency
*/
Expand Down

0 comments on commit 92e67c8

Please sign in to comment.