Skip to content
Permalink
Browse files
Microoptimise opening attribute table - don't call sort on model when
no sort order set

(cherry-picked from 381eef)
  • Loading branch information
nyalldawson committed May 23, 2017
1 parent 8992eea commit 261eba0c9e57874f25cc9c139a78962136604c10
Showing with 4 additions and 3 deletions.
  1. +2 −1 src/gui/attributetable/qgsattributetablefiltermodel.cpp
  2. +2 −2 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -214,7 +214,8 @@ void QgsAttributeTableFilterModel::setAttributeTableConfig( const QgsAttributeTa
}
}

sort( config.sortExpression(), config.sortOrder() );
if ( !config.sortExpression().isEmpty() )
sort( config.sortExpression(), config.sortOrder() );
}

void QgsAttributeTableFilterModel::sort( QString expression, Qt::SortOrder order )
@@ -253,7 +253,7 @@ void QgsAttributeTableModel::editCommandEnded()
void QgsAttributeTableModel::attributeDeleted( int idx )
{
if ( mSortCacheAttributes.contains( idx ) )
prefetchSortData( "" );
prefetchSortData( QString() );
}

void QgsAttributeTableModel::layerDeleted()
@@ -767,7 +767,7 @@ void QgsAttributeTableModel::prefetchColumnData( int column )
{
if ( column == -1 || column >= mAttributes.count() )
{
prefetchSortData( "" );
prefetchSortData( QString() );
}
else
{

0 comments on commit 261eba0

Please sign in to comment.