mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[GRASS] data item fix
This commit is contained in:
parent
7d7ac62f67
commit
eef435e979
@ -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 );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user