Skip to content
Permalink
Browse files

Fix geometry icons in postgres dialog for new wkb types

  • Loading branch information
mhugent committed Oct 15, 2015
1 parent 0ded855 commit f205acf2ba5c942333f3b27c41c4a6877481161f
Showing with 8 additions and 18 deletions.
  1. +8 −18 src/providers/postgres/qgspgtablemodel.cpp
@@ -126,7 +126,7 @@ void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty& layerProper
childItemList << selItem;
childItemList << sqlItem;

Q_FOREACH ( QStandardItem *item, childItemList )
Q_FOREACH( QStandardItem *item, childItemList )
{
if ( tip.isEmpty() )
{
@@ -235,26 +235,16 @@ void QgsPgTableModel::setSql( const QModelIndex &index, const QString &sql )

QIcon QgsPgTableModel::iconForWkbType( QGis::WkbType type )
{
switch ( type )
QgsWKBTypes::GeometryType geomType = QgsWKBTypes::geometryType( QgsWKBTypes::Type( type ) );
switch ( geomType )
{
case QGis::WKBPoint:
case QGis::WKBPoint25D:
case QGis::WKBMultiPoint:
case QGis::WKBMultiPoint25D:
case QgsWKBTypes::PointGeometry:
return QgsApplication::getThemeIcon( "/mIconPointLayer.svg" );
case QGis::WKBLineString:
case QGis::WKBLineString25D:
case QGis::WKBMultiLineString:
case QGis::WKBMultiLineString25D:
case QgsWKBTypes::LineGeometry:
return QgsApplication::getThemeIcon( "/mIconLineLayer.svg" );
case QGis::WKBPolygon:
case QGis::WKBPolygon25D:
case QGis::WKBMultiPolygon:
case QGis::WKBMultiPolygon25D:
case QgsWKBTypes::PolygonGeometry:
return QgsApplication::getThemeIcon( "/mIconPolygonLayer.svg" );
case QGis::WKBNoGeometry:
return QgsApplication::getThemeIcon( "/mIconTableLayer.png" );
case QGis::WKBUnknown:
default:
break;
}
return QgsApplication::getThemeIcon( "/mIconLayer.png" );
@@ -375,7 +365,7 @@ QString QgsPgTableModel::layerURI( const QModelIndex &index, const QString& conn
QgsDataSourceURI uri( connInfo );

QStringList cols;
Q_FOREACH ( const QString& col, s1 )
Q_FOREACH( const QString& col, s1 )
{
cols << QgsPostgresConn::quotedIdentifier( col );
}

0 comments on commit f205acf

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