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 committed Dec 10, 2011
1 parent 315bd85 commit e154f69
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/raster/qgsrasterlayer.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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 @@ -2449,18 +2461,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 @@ -4021,7 +4021,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 e154f69

Please sign in to comment.