Skip to content
Permalink
Browse files

respect attribute table behavior settings

Fixes undocumented bug of attribute table settings (Show features Visible on Map etc.)
not being respected. The settings were saved correctly but QGIS didn't make use of them.

(cherry picked from commit f4aa9a4)
  • Loading branch information
tudorbarascu authored and nyalldawson committed Dec 24, 2018
1 parent a1ea800 commit 06f696575be4247abad5cafa9b4b2d4342b869cc
Showing with 9 additions and 3 deletions.
  1. +5 −1 src/app/qgisapp.cpp
  2. +4 −2 src/app/qgsapplayertreeviewmenuprovider.cpp
@@ -571,8 +571,12 @@ void QgisApp::layerTreeViewDoubleClicked( const QModelIndex &index )
break;
}
case 1:
QgisApp::instance()->attributeTable();
{
QgsSettings settings;
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
QgisApp::instance()->attributeTable( initialMode );
break;
}
case 2:
mapStyleDock( true );
break;
@@ -206,8 +206,10 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
QAction *allEditsAction = QgisApp::instance()->actionAllEdits();

// attribute table
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) ), tr( "&Open Attribute Table" ),
QgisApp::instance(), SLOT( attributeTable() ) );
QgsSettings settings;
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
QAction *attrTableAction = menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) ), tr( "&Open Attribute Table" ) );
connect( attrTableAction, &QAction::triggered, QgisApp::instance(), [ = ] { QgisApp::instance()->attributeTable( initialMode ); } );

// allow editing
int cap = vlayer->dataProvider()->capabilities();

0 comments on commit 06f6965

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