Skip to content

Commit 37fe596

Browse files
author
gcontreras
committed
Fix for ticket #1702, when loading an ogr database datasource with one layer the password appears in legend.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10916 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 497758d commit 37fe596

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/app/qgisapp.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,11 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
23992399
}
24002400
else // there is 1 layer of data available
24012401
{
2402+
//set friendly name for datasources with only one layer
2403+
QStringList sublayers = layer->dataProvider()->subLayers();
2404+
QString ligne = sublayers.at( 0 );
2405+
QStringList elements = ligne.split( ":" );
2406+
layer->setLayerName(elements.at(1));
24022407
// Register this layer with the layers registry
24032408
QgsMapLayerRegistry::instance()->addMapLayer( layer );
24042409
// notify the project we've made a change

0 commit comments

Comments
 (0)