SqliteTableModel: Speed up on large table in certain circumstances

This commit is contained in:
Martin Kleusberg
2013-04-10 19:27:16 +02:00
parent 1ba3169428
commit 334cc26c57

View File

@@ -145,6 +145,10 @@ Qt::ItemFlags SqliteTableModel::flags(const QModelIndex& index) const
void SqliteTableModel::sort(int column, Qt::SortOrder order)
{
// Don't do anything when the sort order hasn't changed
if(m_iSortColumn == column && m_sSortOrder == (order == Qt::AscendingOrder ? "ASC" : "DESC"))
return;
// Save sort order
m_iSortColumn = column;
m_sSortOrder = (order == Qt::AscendingOrder ? "ASC" : "DESC");