Skip to content

Commit

Permalink
fix #3343
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14929 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 16, 2010
1 parent 0a099b5 commit e2df473
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3250,11 +3250,16 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
QgsDebugMsg( "Instantiated the data provider plugin" +
QString( " with layer list of " ) + layers.join( ", " ) + " and style list of " + styles.join( ", " ) +
" and format of " + format + " and CRS of " + crs );
if ( mDataProvider->isValid() )
{
mValid = true;
mValid = mDataProvider->isValid();

if ( mValid )
{
mDataProvider->addLayers( layers, styles );
mValid = mDataProvider->isValid();
}

if ( mValid )
{
mDataProvider->setImageEncoding( format );
mDataProvider->setImageCrs( crs );

Expand Down Expand Up @@ -3287,6 +3292,10 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
*mCRS = QgsCoordinateReferenceSystem( mDataProvider->crs() );
}
}
else
{
QgsLogger::warning( "QgsRasterLayer::setDataProvider: invalid layer" );
}
}
else
{
Expand Down
7 changes: 7 additions & 0 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ void QgsWmsProvider::addLayers( QStringList const &layers,
QgsDebugMsg( "Entering with layer list of " + layers.join( ", " )
+ " and style list of " + styles.join( ", " ) );

if ( layers.size() != styles.size() )
{
QgsDebugMsg( "number of layers and styles don't match" );
valid = false;
return;
}

// TODO: Make activeSubLayers a std::map in order to avoid duplicates
activeSubLayers += layers;
activeSubStyles += styles;
Expand Down

0 comments on commit e2df473

Please sign in to comment.