mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 11:45:40 +08:00
Fixed bug in CListModelBase, avoid double sorting
This commit is contained in:
@@ -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)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user