Skip to content

Commit e154f69

Browse files
committedDec 10, 2011
#3576 fix, load default raster style
1 parent 315bd85 commit e154f69

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed
 

‎src/core/raster/qgsrasterlayer.cpp

100755100644
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ QgsRasterLayer::QgsRasterLayer(
9999
// TODO, call constructor with provider key for now
100100
init();
101101
setDataProvider( "gdal", QStringList(), QStringList(), QString(), QString(), loadDefaultStyleFlag );
102+
103+
if ( mValid && loadDefaultStyleFlag )
104+
{
105+
bool defaultLoadedFlag = false;
106+
loadDefaultStyle( defaultLoadedFlag );
107+
// I'm no sure if this should be used somehow, in pre raster-providers there was
108+
// only mLastViewPort init after this block, nothing to do with style
109+
//if ( defaultLoadedFlag )
110+
//{
111+
//return;
112+
//}
113+
}
102114
return;
103115

104116

@@ -2449,18 +2461,6 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
24492461
//mark the layer as valid
24502462
mValid = true;
24512463

2452-
//loadDefaultStyle() can not be called before the layer has actually be opened
2453-
// TODO ???
2454-
//if ( loadDefaultStyleFlag )
2455-
//{
2456-
//bool defaultLoadedFlag = false;
2457-
//loadDefaultStyle( defaultLoadedFlag );
2458-
//if ( defaultLoadedFlag )
2459-
//{
2460-
//return;
2461-
//}
2462-
//}
2463-
24642464
QgsDebugMsg( "exiting." );
24652465
} // QgsRasterLayer::setDataProvider
24662466

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.