Skip to content
Permalink
Browse files

postgres provider: fix layer detection

  • Loading branch information
jef-n committed Nov 12, 2014
1 parent 40bb180 commit 571d47a889a30ebc93f86edde79fedf5aff91c55
@@ -32,7 +32,6 @@ QGISEXTERN bool deleteLayer( const QString& uri, QString& errCause );
// ---------------------------------------------------------------------------
QgsPGConnectionItem::QgsPGConnectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataCollectionItem( parent, name, path )
, mColumnTypeThread( 0 )
{
mIconName = "mIconConnect.png";
}
@@ -328,16 +327,20 @@ QVector<QgsDataItem*> QgsPGSchemaItem::createChildren()

conn->retrieveLayerTypes( layerProperty, true /* useEstimatedMetadata */ );
}
QgsPGLayerItem *layerItem = createLayer( layerProperty );
if ( layerItem )
items.append( layerItem );

for ( int i = 0; i < layerProperty.size(); i++ )
{
QgsPGLayerItem *layerItem = createLayer( layerProperty.at(i) );
if ( layerItem )
items.append( layerItem );
}
}

QgsPostgresConnPool::instance()->releaseConnection( conn );
return items;
}

QgsPGLayerItem * QgsPGSchemaItem::createLayer( QgsPostgresLayerProperty layerProperty )
QgsPGLayerItem *QgsPGSchemaItem::createLayer( QgsPostgresLayerProperty layerProperty )
{
QgsDebugMsg( "schemaName = " + layerProperty.schemaName + " tableName = " + layerProperty.tableName + " geometryColName = " + layerProperty.geometryColName );
QGis::WkbType wkbType = layerProperty.types[0];
@@ -74,7 +74,6 @@ class QgsPGConnectionItem : public QgsDataCollectionItem
private:
QgsPostgresConn *mConn;
QMap<QString, QgsPGSchemaItem * > mSchemaMap;
QgsGeomColumnTypeThread *mColumnTypeThread;
};

class QgsPGSchemaItem : public QgsDataCollectionItem

0 comments on commit 571d47a

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