[QGIS Commit] r13528 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue May 18 16:36:19 EDT 2010
Author: jef
Date: 2010-05-18 16:36:19 -0400 (Tue, 18 May 2010)
New Revision: 13528
Modified:
trunk/qgis/src/app/qgisapp.cpp
Log:
fix #2732
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2010-05-18 19:01:38 UTC (rev 13527)
+++ trunk/qgis/src/app/qgisapp.cpp 2010-05-18 20:36:19 UTC (rev 13528)
@@ -2541,32 +2541,30 @@
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 @@
}
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
More information about the QGIS-commit
mailing list