Skip to content
Permalink
Browse files
fix #2732
git-svn-id: http://svn.osgeo.org/qgis/trunk@13528 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 18, 2010
1 parent a7a8a29 commit 9c2e17ae6ae984d3f42211afcd1c98e977fd1296
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/app/qgisapp.cpp
@@ -2541,32 +2541,30 @@ void QgisApp::addVectorLayer()
bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QString& enc, const QString dataSourceType )
{

for ( QStringList::ConstIterator it = theLayerQStringList.begin();
it != theLayerQStringList.end();
++it )
foreach( QString src, theLayerQStringList )
{
src = src.trimmed();
QString base;
if ( dataSourceType == "file" )
{
QFileInfo fi( *it );
QFileInfo fi( src );
base = fi.completeBaseName();
}
else if ( dataSourceType == "database" )
{
base = *it;
base = src;
}
else //directory //protocol
{
QFileInfo fi( *it );
QFileInfo fi( src );
base = fi.completeBaseName();
}


QgsDebugMsg( "completeBaseName: " + base );

// create the layer

QgsVectorLayer *layer = new QgsVectorLayer( *it, base, "ogr" );
QgsVectorLayer *layer = new QgsVectorLayer( src, base, "ogr" );
Q_CHECK_PTR( layer );

if ( ! layer )
@@ -2610,7 +2608,7 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
}
else
{
QString msg = tr( "%1 is not a valid or recognized data source" ).arg( *it );
QString msg = tr( "%1 is not a valid or recognized data source" ).arg( src );
QMessageBox::critical( this, tr( "Invalid Data Source" ), msg );

// since the layer is bad, stomp on it

0 comments on commit 9c2e17a

Please sign in to comment.