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.
  • Loading branch information
tudorbarascu authored and nyalldawson committed Dec 24, 2018
1 parent 201523f commit f4aa9a493ba3b50fb447b46125c3cb1680525cc5
Showing with 8 additions and 2 deletions.
  1. +5 −1 src/app/qgisapp.cpp
  2. +3 −1 src/app/qgsapplayertreeviewmenuprovider.cpp
@@ -580,8 +580,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
QgsSettings settings;
QgsAttributeTableFilterModel::FilterMode initialMode = settings.enumValue( QStringLiteral( "qgis/attributeTableBehavior" ), QgsAttributeTableFilterModel::ShowAll );
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionOpenTable.svg" ) ), tr( "&Open Attribute Table" ),
QgisApp::instance(), [ = ] { QgisApp::instance()->attributeTable(); } );
QgisApp::instance(), [ = ] { QgisApp::instance()->attributeTable( initialMode ); } );

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

0 comments on commit f4aa9a4

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