Skip to content
Permalink
Browse files

some crashes on loading project fixed

  • Loading branch information
blazek committed Jun 14, 2012
1 parent 002384b commit 1fed135bc4978c857270fcedf5a5d355dadb0015
Showing with 10 additions and 1 deletion.
  1. +2 −1 src/core/qgsprojectfiletransform.cpp
  2. +8 −0 src/core/raster/qgsrasterlayer.cpp
@@ -469,7 +469,8 @@ void QgsProjectFileTransform::transform1800to1900()
QDomNode layerNode = rasterPropertiesElem.parentNode();
QDomElement dataSourceElem = layerNode.firstChildElement( "datasource" );
QDomElement layerNameElem = layerNode.firstChildElement( "layername" );
QgsRasterLayer rasterLayer( QgsProject::instance()->readPath( dataSourceElem.text() ), layerNameElem.text() );
QDomElement layerProviderElem = layerNode.firstChildElement( "provider" );
QgsRasterLayer rasterLayer( QgsProject::instance()->readPath( dataSourceElem.text() ), layerNameElem.text(), layerProviderElem.isNull() ? "gdal" : layerProviderElem.text() );
convertRasterProperties( mDom, layerNode, rasterPropertiesElem, &rasterLayer );
}
QgsDebugMsg( mDom.toString() );
@@ -92,6 +92,14 @@ typedef bool isvalidrasterfilename_t( QString const & theFileNameQString, QStrin

QgsRasterLayer::QgsRasterLayer()
: QgsMapLayer( RasterLayer )
, QSTRING_NOT_SET( "Not Set" )
, TRSTRING_NOT_SET( tr( "Not Set" ) )
, mStandardDeviations( 0 )
, mDataProvider( 0 )
, mWidth( std::numeric_limits<int>::max() )
, mHeight( std::numeric_limits<int>::max() )
, mInvertColor( false )
, mRenderer( 0 )
{
init();
mValid = false;

0 comments on commit 1fed135

Please sign in to comment.
You can’t perform that action at this time.