Skip to content
Permalink
Browse files
fix crash on layerless OGR data sources
git-svn-id: http://svn.osgeo.org/qgis/trunk@13817 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 27, 2010
1 parent 70c4605 commit 0c1a961268c19875729dddba1a0e8a3fdeec28a7
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/app/qgisapp.cpp
@@ -2627,7 +2627,7 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
delete layer;

}
else // there is 1 layer of data available
else if ( sublayers.count() > 0 ) // there is 1 layer of data available
{
//set friendly name for datasources with only one layer
QStringList sublayers = layer->dataProvider()->subLayers();
@@ -2637,6 +2637,12 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer( layer );
}
else
{
QString msg = tr( "%1 doesn't have any layers" ).arg( src );
QMessageBox::critical( this, tr( "Invalid Data Source" ), msg );
delete layer;
}
}
else
{

0 comments on commit 0c1a961

Please sign in to comment.