Skip to content
Permalink
Browse files

fix #2543

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13047 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 11, 2010
1 parent 8fce780 commit 01dcd47ecf9bef4efa6dc0ce3eafbc8d98b0fa1c
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/gui/qgsmapcanvas.cpp
@@ -222,20 +222,25 @@ const QgsMapToPixel * QgsMapCanvas::getCoordinateTransform()
return mMapRenderer->coordinateTransform();
}

void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer>& layers )
void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer> &layers )
{
if ( mDrawing )
{
return;
}
int i;

// create layer set
QStringList layerSet, layerSetOverview;

int i;
for ( i = 0; i < layers.size(); i++ )
{
QgsMapCanvasLayer& lyr = layers[i];
QgsMapCanvasLayer &lyr = layers[i];
if ( !lyr.layer() )
{
continue;
}

if ( lyr.isVisible() )
{
layerSet.push_back( lyr.layer()->getLayerID() );
@@ -248,7 +253,7 @@ void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer>& layers )

QStringList& layerSetOld = mMapRenderer->layerSet();

bool layerSetChanged = ( layerSetOld != layerSet );
bool layerSetChanged = layerSetOld != layerSet;

// update only if needed
if ( layerSetChanged )
@@ -1170,11 +1175,11 @@ int QgsMapCanvas::layerCount() const
QList<QgsMapLayer*> QgsMapCanvas::layers() const
{
QList<QgsMapLayer*> lst;
foreach ( QString layerID, mMapRenderer->layerSet() )
foreach( QString layerID, mMapRenderer->layerSet() )
{
QgsMapLayer* layer = QgsMapLayerRegistry::instance()->mapLayer( layerID );
if ( layer )
lst.append(layer);
lst.append( layer );
}
return lst;
}

0 comments on commit 01dcd47

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