Skip to content
Permalink
Browse files

[GRASS] data item fix

  • Loading branch information
blazek committed Nov 18, 2014
1 parent 7d7ac62 commit eef435e979bdc455bc7bc0ffd57518974af257c5
Showing with 6 additions and 6 deletions.
  1. +1 −3 python/core/qgsdataitem.sip
  2. +3 −1 src/core/qgsdataitem.h
  3. +2 −2 src/providers/grass/qgsgrassprovidermodule.cpp
@@ -30,6 +30,7 @@ class QgsDataItem : QObject
// Populate children using children vector created by createChildren()
virtual void populate();
bool isPopulated();
void setPopulated();

// Insert new child using alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals
// refresh - refresh populated item, emit signals to model
@@ -55,8 +56,6 @@ class QgsDataItem : QObject
// try to process the data dropped on this item
virtual bool handleDrop( const QMimeData * /*data*/, Qt::DropAction /*action*/ );

//

enum Capability
{
NoCapabilities,
@@ -162,7 +161,6 @@ class QgsDataCollectionItem : QgsDataItem
QgsDataCollectionItem( QgsDataItem* parent, QString name, QString path = QString::null );
~QgsDataCollectionItem();

void setPopulated();
void addChild( QgsDataItem *item /Transfer/ );

static const QIcon &iconDir(); // shared icon: open/closed directory
@@ -67,6 +67,9 @@ class CORE_EXPORT QgsDataItem : public QObject
virtual void populate( QVector<QgsDataItem*> children );
bool isPopulated() { return mPopulated; }

// Set as populated without populating
void setPopulated() { mPopulated = true; }

// Insert new child using alphabetical order based on mName, emits necessary signal to model before and after, sets parent and connects signals
// refresh - refresh populated item, emit signals to model
virtual void addChildItem( QgsDataItem *child, bool refresh = false );
@@ -221,7 +224,6 @@ class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
QgsDataCollectionItem( QgsDataItem* parent, QString name, QString path = QString::null );
~QgsDataCollectionItem();

void setPopulated() { mPopulated = true; }
void addChild( QgsDataItem *item ) { mChildren.append( item ); }

static const QIcon &iconDir(); // shared icon: open/closed directory
@@ -132,7 +132,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
{
/* 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
layer->setPopulated();
items.append( layer );
}
else
@@ -154,7 +154,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
QgsDebugMsg( "uri = " + uri );

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

items.append( layer );
}

0 comments on commit eef435e

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