Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit ff8c4635 authored by Christian Ehrlicher's avatar Christian Ehrlicher

Sort List by piece count does not work

The sorting in the overview dialog did not work because the
QSortFilterProxyModel was not set up correctly

BUG: 376607

Test Plan:
Test if the sorting works by selecting the appropriate sorting

Reviewers: #kde_games, ltoscano

Reviewed By: ltoscano

Subscribers: ltoscano, #kde_games

Differential Revision:
parent 851870fb
......@@ -57,7 +57,10 @@ Palapeli::CollectionView::CollectionView(QWidget* parent)
connect(m_view->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(handleSelectionChanged()));
m_proxyModel->sort(Qt::DisplayRole, Qt::AscendingOrder);
m_proxyModel->sort(0, Qt::AscendingOrder);
//TODO: save sorting role between sessions
//setup filter search line
KFilterProxySearchLine* searchLine = new KFilterProxySearchLine(this);
......@@ -126,7 +129,7 @@ void Palapeli::CollectionView::sortMenuTriggered(QAction* action)
if (action == m_sortByPieceCount)
sortRole = Palapeli::Collection::PieceCountRole;
//update sorting and menu
m_proxyModel->sort(sortRole, Qt::AscendingOrder);
m_sortByTitle->setChecked(sortRole == Qt::DisplayRole);
m_sortByPieceCount->setChecked(sortRole == Palapeli::Collection::PieceCountRole);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment