Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #2732
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13528 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 18, 2010
1 parent 37a82ab commit 5c10869
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/app/qgisapp.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5c10869

Please sign in to comment.