Fix sort order when searching, resolves #319

This commit is contained in:
Janek Bevendorff 2017-02-17 14:18:18 +01:00
parent ebdb10e7f9
commit b61ecabed3
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53

View File

@ -140,15 +140,21 @@ Entry* EntryView::entryFromIndex(const QModelIndex& index)
void EntryView::switchToEntryListMode()
{
m_sortModel->hideColumn(0, false);
sortByColumn(1, Qt::AscendingOrder); // TODO: should probably be improved
m_sortModel->sort(1, Qt::AscendingOrder);
m_sortModel->sort(0, Qt::AscendingOrder);
sortByColumn(0, Qt::AscendingOrder);
m_inEntryListMode = true;
}
void EntryView::switchToGroupMode()
{
m_sortModel->hideColumn(0, true);
sortByColumn(-1, Qt::AscendingOrder);
m_sortModel->sort(-1, Qt::AscendingOrder);
m_sortModel->sort(0, Qt::AscendingOrder);
sortByColumn(0, Qt::AscendingOrder);
m_inEntryListMode = false;
}