Qt: Use path as tie breaker when sort titles equal

pull/3544/head
Stenzek 2 months ago
parent f2f06a746b
commit e1c0753d3d
No known key found for this signature in database

@ -7878,7 +7878,11 @@ void FullscreenUI::PopulateGameListEntryList()
// fallback to title when all else is equal
const int res = StringUtil::CompareNoCase(lhs->GetSortTitle(), rhs->GetSortTitle());
if (res != 0)
return reverse ? (res > 0) : (res < 0);
// fallback to path when all else is equal
return reverse ? (lhs->path > rhs->path) : (lhs->path < rhs->path);
});
}

@ -814,7 +814,12 @@ void GameListModel::refresh()
bool GameListModel::titlesLessThan(const GameList::Entry* left, const GameList::Entry* right) const
{
return (StringUtil::CompareNoCase(left->GetSortTitle(), right->GetSortTitle()) < 0);
const s32 res = StringUtil::CompareNoCase(left->GetSortTitle(), right->GetSortTitle());
if (res != 0)
return (res < 0);
// Fallback to path compare if titles are the same.
return (left->path < right->path);
}
bool GameListModel::lessThan(const QModelIndex& left_index, const QModelIndex& right_index, int column) const

Loading…
Cancel
Save