Skip to content
Permalink
Browse files

Fix refresh of postgis schema in browser (#4400)

  • Loading branch information
wonder-sk committed Oct 19, 2011
1 parent 5b89a32 commit b1e503851d4c78bab403cced534df7fa46b80d13
Showing with 17 additions and 4 deletions.
  1. +11 −4 src/providers/postgres/qgspostgresdataitems.cpp
  2. +6 −0 src/providers/postgres/qgspostgresdataitems.h
@@ -122,9 +122,16 @@ QgsPGSchemaItem::QgsPGSchemaItem( QgsDataItem* parent, QString name, QString pat
: QgsDataCollectionItem( parent, name, path )
{
mIcon = QIcon( getThemePixmap( "mIconDbSchema.png" ) );
mConnInfo = connInfo;
mLayerProperties = layerProperties;
populate();
}

QVector<QgsDataItem*> QgsPGSchemaItem::createChildren()
{
QVector<QgsDataItem*> children;
// Populate everything, it costs nothing, all info about layers is collected
foreach( QgsPostgresLayerProperty layerProperty, layerProperties )
foreach( QgsPostgresLayerProperty layerProperty, mLayerProperties )
{
QgsDebugMsg( "table: " + layerProperty.schemaName + "." + layerProperty.tableName );

@@ -149,11 +156,11 @@ QgsPGSchemaItem::QgsPGSchemaItem( QgsDataItem* parent, QString name, QString pat
}
}

QgsPGLayerItem * layer = new QgsPGLayerItem( this, layerProperty.tableName, mPath + "/" + layerProperty.tableName, connInfo, layerType, layerProperty );
mChildren.append( layer );
QgsPGLayerItem * layer = new QgsPGLayerItem( this, layerProperty.tableName, mPath + "/" + layerProperty.tableName, mConnInfo, layerType, layerProperty );
children.append( layer );
}

mPopulated = true;
return children;
}

QgsPGSchemaItem::~QgsPGSchemaItem()
@@ -48,6 +48,12 @@ class QgsPGSchemaItem : public QgsDataCollectionItem
QgsPGSchemaItem( QgsDataItem* parent, QString name, QString path,
QString connInfo, QVector<QgsPostgresLayerProperty> layerProperties );
~QgsPGSchemaItem();

QVector<QgsDataItem*> createChildren();

protected:
QString mConnInfo;
QVector<QgsPostgresLayerProperty> mLayerProperties;
};

class QgsPGRootItem : public QgsDataCollectionItem

0 comments on commit b1e5038

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