From 9e6a9a28cb938717b10c7d23ea30c425bb34c76b Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 16 Sep 2014 22:06:22 +0200 Subject: [PATCH] Fixed bug in CListModelBase, avoid double sorting --- src/blackgui/models/listmodelbase.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/blackgui/models/listmodelbase.cpp b/src/blackgui/models/listmodelbase.cpp index 247225ec7..fa2bc0f3f 100644 --- a/src/blackgui/models/listmodelbase.cpp +++ b/src/blackgui/models/listmodelbase.cpp @@ -172,14 +172,15 @@ namespace BlackGui */ template void CListModelBase::sort(int column, Qt::SortOrder order) { + if (column == this->m_sortedColumn && order == this->m_sortOrder) { return; } + + // new order this->m_sortedColumn = column; - this->m_sortOrder = order; + this->m_sortOrder = order; if (this->m_container.size() < 2) return; // nothing to do // sort the values - this->update( - this->sortListByColumn(this->m_container, column, order) - ); + this->update(this->m_container, true); } /*