Skip to content

Commit

Permalink
Make sure recent expression group is always listed last (fix #13462)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 5, 2015
1 parent 74110bb commit 1fd3ed7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/qgsexpressionbuilderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ void QgsExpressionBuilderWidget::registerItem( QString group,
// If the group doesn't exist yet we make it first.
QgsExpressionItem *newgroupNode = new QgsExpressionItem( QgsExpression::group( group ), "", QgsExpressionItem::Header );
newgroupNode->setData( group, Qt::UserRole );
newgroupNode->setData( group == "Recent (Selection)" ? 2 : 1, QgsExpressionItem::CustomSortRole );
//Recent group should always be last group
newgroupNode->setData( group.startsWith( "Recent (" ) ? 2 : 1, QgsExpressionItem::CustomSortRole );
newgroupNode->appendRow( item );
newgroupNode->setBackground( QBrush( QColor( "#eee" ) ) );
mModel->appendRow( newgroupNode );
Expand Down

0 comments on commit 1fd3ed7

Please sign in to comment.