Skip to content
Permalink
Browse files

Browser layer item: don't propose 'File Properties' for a non-file item

  • Loading branch information
github-actions authored and nyalldawson committed Nov 15, 2020
1 parent 872793e commit 48f4574db2222f26b81229087be9dd2b440218f9
Showing with 1 addition and 13 deletions.
  1. +1 −13 src/app/browser/qgsinbuiltdataitemproviders.cpp
@@ -547,19 +547,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men

if ( QgsGui::nativePlatformInterface()->capabilities() & QgsNative::NativeFilePropertiesDialog )
{
bool isFile = false;
if ( layerItem )
{
// Also check for postgres layers (rasters are handled by GDAL)
isFile = ( layerItem->providerKey() == QLatin1String( "ogr" ) ||
layerItem->providerKey() == QLatin1String( "gdal" ) ) &&
! layerItem->uri().startsWith( QLatin1String( "PG:" ) );
}
else
{
isFile = QFileInfo::exists( item->path() );
}
if ( isFile )
if ( QFileInfo::exists( item->path() ) )
{
QAction *action = menu->addAction( tr( "File Properties…" ) );
connect( action, &QAction::triggered, this, [ = ]

0 comments on commit 48f4574

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