Skip to content

Commit

Permalink
respect attribute table behavior settings
Browse files Browse the repository at this point in the history
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 Jan 3, 2019
1 parent 201523f commit f4aa9a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/app/qgsapplayertreeviewmenuprovider.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit f4aa9a4

Please sign in to comment.