Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for ticket #1702, when loading an ogr database datasource with on…
…e layer the password appears in legend.

git-svn-id: http://svn.osgeo.org/qgis/trunk@10916 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gcontreras committed Jun 12, 2009
1 parent 27ad692 commit f112d81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -2399,6 +2399,11 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
}
else // there is 1 layer of data available
{
//set friendly name for datasources with only one layer
QStringList sublayers = layer->dataProvider()->subLayers();
QString ligne = sublayers.at( 0 );
QStringList elements = ligne.split( ":" );
layer->setLayerName(elements.at(1));
// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer( layer );
// notify the project we've made a change
Expand Down

0 comments on commit f112d81

Please sign in to comment.