Skip to content
Permalink
Browse files

fix #3153

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14433 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Oct 25, 2010
1 parent e69a363 commit bdcca916ff1a23669e55f5d950b68eea86d15a99
Showing with 14 additions and 4 deletions.
  1. +4 −1 src/app/postgres/qgspgsourceselect.cpp
  2. +1 −1 src/app/qgsquerybuilder.cpp
  3. +9 −2 src/core/qgsvectorlayer.cpp
@@ -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 );
}
}
}

0 comments on commit bdcca91

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