Skip to content
Permalink
Browse files

Merge 193b7b7 into cherry-pick-backport-9449-on-release-3_6-4017097e-…

…7318-4168-a11e-240685920a5e
  • Loading branch information
backporting committed Mar 10, 2019
2 parents 7ccbdc1 + 193b7b7 commit 7063a5d3d7f602d23be6aa1a8b2ee1d91531b950
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/providers/postgres/qgspostgresdataitems.cpp
@@ -516,7 +516,7 @@ QString QgsPGLayerItem::createUri()

uri.setDataSource( mLayerProperty.schemaName, mLayerProperty.tableName, mLayerProperty.geometryColName, mLayerProperty.sql, cols.join( ',' ) );
uri.setWkbType( mLayerProperty.types.at( 0 ) );
if ( uri.wkbType() != QgsWkbTypes::NoGeometry )
if ( uri.wkbType() != QgsWkbTypes::NoGeometry && mLayerProperty.srids.at( 0 ) != std::numeric_limits<int>::min() )
uri.setSrid( QString::number( mLayerProperty.srids.at( 0 ) ) );
QgsDebugMsg( QStringLiteral( "layer uri: %1" ).arg( uri.uri( false ) ) );
return uri.uri( false );
@@ -750,7 +750,12 @@ QgsPGLayerItem *QgsPGSchemaItem::createLayer( QgsPostgresLayerProperty layerProp
tip = tr( "Table" );
}
QgsWkbTypes::Type wkbType = layerProperty.types.at( 0 );
tip += tr( "\n%1 as %2 in %3" ).arg( layerProperty.geometryColName, QgsPostgresConn::displayStringForWkbType( wkbType ) ).arg( layerProperty.srids.at( 0 ) );
tip += tr( "\n%1 as %2" ).arg( layerProperty.geometryColName, QgsPostgresConn::displayStringForWkbType( wkbType ) );
if ( layerProperty.srids.at( 0 ) != std::numeric_limits<int>::min() )
tip += tr( " (srid %1)" ).arg( layerProperty.srids.at( 0 ) );
else
tip += tr( " (unknown srid)" );

if ( !layerProperty.tableComment.isEmpty() )
{
tip = layerProperty.tableComment + '\n' + tip;

0 comments on commit 7063a5d

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