mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
feat(#62838): PR feedback assets on-demand
This commit is contained in:
parent
4251616e69
commit
813b161335
@ -114,6 +114,7 @@ QgsStacItemItem::QgsStacItemItem( QgsDataItem *parent, const QString &name, cons
|
|||||||
: QgsDataItem( Qgis::BrowserItemType::Custom, parent, name.isEmpty() ? path : name, path, QStringLiteral( "special:Stac" ) )
|
: QgsDataItem( Qgis::BrowserItemType::Custom, parent, name.isEmpty() ? path : name, path, QStringLiteral( "special:Stac" ) )
|
||||||
{
|
{
|
||||||
mIconName = QStringLiteral( "mActionPropertiesWidget.svg" );
|
mIconName = QStringLiteral( "mActionPropertiesWidget.svg" );
|
||||||
|
mCapabilities |= Qgis::BrowserItemCapability::Fast;
|
||||||
updateToolTip();
|
updateToolTip();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +127,7 @@ QVector<QgsDataItem *> QgsStacItemItem::createChildren()
|
|||||||
if ( !mStacItem )
|
if ( !mStacItem )
|
||||||
return { new QgsErrorItem( this, error, path() + QStringLiteral( "/error" ) ) };
|
return { new QgsErrorItem( this, error, path() + QStringLiteral( "/error" ) ) };
|
||||||
|
|
||||||
|
setState( Qgis::BrowserItemState::Populating );
|
||||||
QVector<QgsDataItem *> contents;
|
QVector<QgsDataItem *> contents;
|
||||||
contents.reserve( mStacItem->assets().size() );
|
contents.reserve( mStacItem->assets().size() );
|
||||||
const QMap<QString, QgsStacAsset> assets = mStacItem->assets();
|
const QMap<QString, QgsStacAsset> assets = mStacItem->assets();
|
||||||
@ -318,7 +320,6 @@ void QgsStacCatalogItem::childrenCreated()
|
|||||||
if ( item->state() != Qgis::BrowserItemState::NotPopulated )
|
if ( item->state() != Qgis::BrowserItemState::NotPopulated )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
item->setIconName( QStringLiteral( "mActionIdentify.svg" ) );
|
|
||||||
const int requestId = stacController()->fetchStacObjectAsync( item->path() );
|
const int requestId = stacController()->fetchStacObjectAsync( item->path() );
|
||||||
item->setProperty( "requestId", requestId );
|
item->setProperty( "requestId", requestId );
|
||||||
}
|
}
|
||||||
@ -523,9 +524,7 @@ QVector< QgsDataItem * > QgsStacCatalogItem::createItems( const QVector<QgsStacI
|
|||||||
|
|
||||||
QgsStacItemItem *i = new QgsStacItemItem( this, name, item->url() );
|
QgsStacItemItem *i = new QgsStacItemItem( this, name, item->url() );
|
||||||
i->setStacItem( std::move( object ) );
|
i->setStacItem( std::move( object ) );
|
||||||
// create any assets beneath the item, so that they can be individually drag-dropped as layers if compatible
|
i->setState( Qgis::BrowserItemState::NotPopulated );
|
||||||
i->populate( true );
|
|
||||||
i->setState( Qgis::BrowserItemState::Populated );
|
|
||||||
contents.append( i );
|
contents.append( i );
|
||||||
}
|
}
|
||||||
return contents;
|
return contents;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user