Skip to content

Commit

Permalink
#3576 fix, load default raster style
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek authored and alexbruy committed Dec 10, 2011
1 parent 55c5a2b commit 1ff94bd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit 1ff94bd

Please sign in to comment.