Skip to content
Permalink
Browse files

fix #1644

git-svn-id: http://svn.osgeo.org/qgis/trunk@10605 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Apr 20, 2009
1 parent 20edfed commit d72d5abc27c5676e5a08c70a54e3d577ee8b8518
Showing with 8 additions and 7 deletions.
  1. +8 −7 src/core/qgsvectorlayer.cpp
@@ -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

0 comments on commit d72d5ab

Please sign in to comment.
You can’t perform that action at this time.