Skip to content

Commit

Permalink
some crashes on loading project fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jun 14, 2012
1 parent 002384b commit 1fed135
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgsprojectfiletransform.cpp
Expand Up @@ -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() );
Expand Down
8 changes: 8 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 1fed135

Please sign in to comment.