Fixed bug in CListModelBase, avoid double sorting

This commit is contained in:
Klaus Basan
2014-09-16 22:06:22 +02:00
parent 2a11411bc0
commit 9e6a9a28cb

View File

@@ -172,14 +172,15 @@ namespace BlackGui
*/ */
template <typename ObjectType, typename ContainerType> void CListModelBase<ObjectType, ContainerType>::sort(int column, Qt::SortOrder order) template <typename ObjectType, typename ContainerType> void CListModelBase<ObjectType, ContainerType>::sort(int column, Qt::SortOrder order)
{ {
if (column == this->m_sortedColumn && order == this->m_sortOrder) { return; }
// new order
this->m_sortedColumn = column; this->m_sortedColumn = column;
this->m_sortOrder = order; this->m_sortOrder = order;
if (this->m_container.size() < 2) return; // nothing to do if (this->m_container.size() < 2) return; // nothing to do
// sort the values // sort the values
this->update( this->update(this->m_container, true);
this->sortListByColumn(this->m_container, column, order)
);
} }
/* /*