Skip to content
Permalink
Browse files
Microoptimise opening attribute table - don't call sort on model when…
… no sort order set
  • Loading branch information
nyalldawson committed May 23, 2017
1 parent ebee101 commit 381eef08c660193394a0f06666181a76f7d52317
Showing with 4 additions and 3 deletions.
  1. +2 −1 src/gui/attributetable/qgsattributetablefiltermodel.cpp
  2. +2 −2 src/gui/attributetable/qgsattributetablemodel.cpp
@@ -215,7 +215,8 @@ void QgsAttributeTableFilterModel::setAttributeTableConfig( const QgsAttributeTa
}
}

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

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

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

0 comments on commit 381eef0

Please sign in to comment.