postgres data items: don't set srid for geometryless layers

This commit is contained in:
Juergen E. Fischer 2015-04-07 17:54:51 +02:00
parent 12d7cfca03
commit d6e22af949

View File

@ -263,8 +263,9 @@ QString QgsPGLayerItem::createUri()
QgsDataSourceURI uri( QgsPostgresConn::connUri( connItem->name() ).connectionInfo() );
uri.setDataSource( mLayerProperty.schemaName, mLayerProperty.tableName, mLayerProperty.geometryColName, mLayerProperty.sql, pkColName );
uri.setSrid( QString::number( mLayerProperty.srids[0] ) );
uri.setWkbType( mLayerProperty.types[0] );
if ( uri.wkbType() != QGis::WKBNoGeometry )
uri.setSrid( QString::number( mLayerProperty.srids[0] ) );
QgsDebugMsg( QString( "layer uri: %1" ).arg( uri.uri() ) );
return uri.uri();
}