mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix #1644
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10605 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
969e9f0d5a
commit
4ac3e65491
@ -2188,11 +2188,11 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
|
||||
|
||||
// adjust the display name for postgres layers
|
||||
QRegExp reg( "\"[^\"]+\"\\.\"([^\"]+)\" \\(([^)]+)\\)" );
|
||||
reg.indexIn( name() );
|
||||
QStringList stuff = reg.capturedTexts();
|
||||
QString lName = stuff[1];
|
||||
if ( stuff.size() == 3 )
|
||||
if ( reg.indexIn( name() ) >= 0 )
|
||||
{
|
||||
QStringList stuff = reg.capturedTexts();
|
||||
QString lName = stuff[1];
|
||||
|
||||
const QMap<QString, QgsMapLayer*> &layers = QgsMapLayerRegistry::instance()->mapLayers();
|
||||
|
||||
QMap<QString, QgsMapLayer*>::const_iterator it;
|
||||
@ -2201,10 +2201,11 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
|
||||
|
||||
if ( it != layers.constEnd() )
|
||||
lName += "." + stuff[2];
|
||||
|
||||
if ( !lName.isEmpty() )
|
||||
setLayerName( lName );
|
||||
}
|
||||
else if ( lName.length() == 0 ) // fallback
|
||||
lName = name();
|
||||
setLayerName( lName );
|
||||
|
||||
QgsDebugMsg( "Beautifying layer name " + name() );
|
||||
|
||||
// deal with unnecessary schema qualification to make v.in.ogr happy
|
||||
|
Loading…
x
Reference in New Issue
Block a user