Merge pull request #320 from keepassxreboot/hotfix/319-search-sort-order

Fix sort order when searching
This commit is contained in:
louib 2017-02-17 09:48:38 -05:00 committed by GitHub
commit d44b811b0d

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;
}