Skip to content

Commit

Permalink
GRASS: show layers non expandable
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Nov 6, 2014
1 parent 7c52e7d commit 443264f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/providers/grass/qgsgrassprovidermodule.cpp
Expand Up @@ -112,7 +112,9 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()

if ( layerNames.size() == 1 )
{
/* This may happen (one layer only) in GRASS 7 with points (no topo layers) */
QgsLayerItem *layer = new QgsLayerItem( this, name + " " + baseLayerName, path, uri, layerType, "grass" );
layer->populate(); // does nothing, but sets mPopulated to true to show non expandable in browser
items.append( layer );
}
else
Expand All @@ -133,6 +135,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
QgsDebugMsg( "uri = " + uri );

QgsLayerItem *layer = new QgsLayerItem( this, name, uri, uri, QgsLayerItem::Raster, "grassraster" );
layer->populate(); // does nothing, but sets mPopulated to true to show non expandable in browser

items.append( layer );
}
Expand All @@ -144,6 +147,7 @@ QgsGrassVectorLayerItem::QgsGrassVectorLayerItem( QgsDataItem* parent, QString m
: QgsLayerItem( parent, layerName, path, uri, layerType, providerKey )
, mMapName( mapName )
{
mPopulated = true; // no children, to show non expandable in browser
}

QString QgsGrassVectorLayerItem::layerName() const
Expand Down

0 comments on commit 443264f

Please sign in to comment.