[QGIS Commit] r10916 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Jun 12 16:47:33 EDT 2009


Author: gcontreras
Date: 2009-06-12 16:47:33 -0400 (Fri, 12 Jun 2009)
New Revision: 10916

Modified:
   trunk/qgis/src/app/qgisapp.cpp
Log:
Fix for ticket #1702, when loading an ogr database datasource with one layer the password appears in legend.

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2009-06-12 20:43:24 UTC (rev 10915)
+++ trunk/qgis/src/app/qgisapp.cpp	2009-06-12 20:47:33 UTC (rev 10916)
@@ -2399,6 +2399,11 @@
       }
       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



More information about the QGIS-commit mailing list