load default style if provider is gdal and if no style was given

This commit is contained in:
Etienne Tourigny 2012-04-24 19:14:27 -03:00
parent df87ee9591
commit 66e3fcb6f3

View File

@ -155,6 +155,14 @@ QgsRasterLayer::QgsRasterLayer( int dummy,
bool loadDefaultStyleFlag = false ; // ???
setDataProvider( providerKey, layers, styles, format, crs, loadDefaultStyleFlag );
// load default style if provider is gdal and if no style was given
// this should be an argument like in the other constructor
if ( mValid && providerKey == "gdal" && layers.isEmpty() && styles.isEmpty() )
{
bool defaultLoadedFlag = false;
loadDefaultStyle( defaultLoadedFlag );
}
// Default for the popup menu
// TODO: popMenu = 0;