Skip to content
Permalink
Browse files
#3576 fix, load default raster style
  • Loading branch information
blazek authored and alexbruy committed Dec 10, 2011
1 parent 55c5a2b commit 1ff94bd072466097e620b3ab03508cec256b1daa
Showing with 13 additions and 13 deletions.
  1. +13 −13 src/core/raster/qgsrasterlayer.cpp
@@ -100,6 +100,18 @@ QgsRasterLayer::QgsRasterLayer(
// TODO, call constructor with provider key for now
init();
setDataProvider( "gdal", QStringList(), QStringList(), QString(), QString(), loadDefaultStyleFlag );

if ( mValid && loadDefaultStyleFlag )
{
bool defaultLoadedFlag = false;
loadDefaultStyle( defaultLoadedFlag );
// I'm no sure if this should be used somehow, in pre raster-providers there was
// only mLastViewPort init after this block, nothing to do with style
//if ( defaultLoadedFlag )
//{
//return;
//}
}
return;


@@ -2354,18 +2366,6 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
//mark the layer as valid
mValid = true;

//loadDefaultStyle() can not be called before the layer has actually be opened
// TODO ???
//if ( loadDefaultStyleFlag )
//{
//bool defaultLoadedFlag = false;
//loadDefaultStyle( defaultLoadedFlag );
//if ( defaultLoadedFlag )
//{
//return;
//}
//}

QgsDebugMsg( "exiting." );
} // QgsRasterLayer::setDataProvider

@@ -3919,7 +3919,7 @@ void QgsRasterLayer::drawPalettedSingleBandGray( QPainter * theQPainter, QgsRast
int myAlphaValue = 0;

while ( imageBuffer.nextScanLine( &imageScanLine, &rasterScanLine )
&& ( !transparencyImageBuffer || transparencyImageBuffer->nextScanLine( &transparencyImageScanLine, &transparencyRasterScanLine ) ) )
&& ( !transparencyImageBuffer || transparencyImageBuffer->nextScanLine( &transparencyImageScanLine, &transparencyRasterScanLine ) ) )
{
for ( int i = 0; i < theRasterViewPort->drawableAreaXDim; ++i )
{

0 comments on commit 1ff94bd

Please sign in to comment.