Skip to content

Commit 443264f

Browse files
committedNov 6, 2014
GRASS: show layers non expandable
1 parent 7c52e7d commit 443264f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/providers/grass/qgsgrassprovidermodule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
112112

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

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

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

149153
QString QgsGrassVectorLayerItem::layerName() const

0 commit comments

Comments
 (0)
Please sign in to comment.