mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
fix #3153
git-svn-id: http://svn.osgeo.org/qgis/trunk@14433 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
9c256d348b
commit
5cb3ae739d
@ -548,7 +548,10 @@ void QgsPgSourceSelect::setSql( const QModelIndex &index )
|
||||
return;
|
||||
}
|
||||
|
||||
QgsVectorLayer *vlayer = new QgsVectorLayer( layerURI( mProxyModel.mapToSource( index ) ), "querybuilder", "postgres" );
|
||||
QModelIndex idx = mProxyModel.mapToSource( index );
|
||||
QString tableName = mTableModel.itemFromIndex( idx.sibling( idx.row(), QgsDbTableModel::dbtmTable ) )->text();
|
||||
|
||||
QgsVectorLayer *vlayer = new QgsVectorLayer( layerURI( idx ), tableName, "postgres" );
|
||||
|
||||
if ( !vlayer->isValid() )
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ QgsQueryBuilder::QgsQueryBuilder( QgsVectorLayer *layer,
|
||||
|
||||
mOrigSubsetString = layer->subsetString();
|
||||
|
||||
lblDataUri->setText( layer->publicSource() );
|
||||
lblDataUri->setText( layer->name() );
|
||||
txtSQL->setText( mOrigSubsetString );
|
||||
|
||||
populateFields();
|
||||
|
@ -4150,8 +4150,15 @@ void QgsVectorLayer::setCoordinateSystem()
|
||||
//we only nee to do that if the srs is not alreay valid
|
||||
if ( !mCRS->isValid() )
|
||||
{
|
||||
mCRS->setValidationHint( tr( "Specify CRS for layer %1" ).arg( name() ) );
|
||||
mCRS->validate();
|
||||
if ( geometryType() != QGis::NoGeometry )
|
||||
{
|
||||
mCRS->setValidationHint( tr( "Specify CRS for layer %1" ).arg( name() ) );
|
||||
mCRS->validate();
|
||||
}
|
||||
else
|
||||
{
|
||||
mCRS->createFromProj4( GEOPROJ4 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user