Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt/GameList: Always sort games alphabetically #6726

Merged
merged 1 commit into from May 3, 2018

Conversation

spycrab
Copy link
Contributor

@spycrab spycrab commented May 1, 2018

Even when sorting by another column (e.g. Platform) an alphabetical order within that sorting must be upheld.

@@ -15,3 +15,27 @@ bool ListProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_
GameListModel* glm = qobject_cast<GameListModel*>(sourceModel());
return glm->ShouldDisplayGameListItem(source_row);
}

#include <QDebug>

This comment was marked as off-topic.


if (sortOrder() == Qt::AscendingOrder)
return leftTitle < rightTitle;
else

This comment was marked as off-topic.


if (sortOrder() == Qt::AscendingOrder)
return QSortFilterProxyModel::lessThan(left, right);
else

This comment was marked as off-topic.

// If two items are otherwise equal, compare them by their title
if (left.data(Qt::InitialSortOrderRole) == right.data(Qt::InitialSortOrderRole))
{
const auto rightTitle =

This comment was marked as off-topic.

bool ListProxyModel::lessThan(const QModelIndex& left, const QModelIndex& right) const
{
// If two items are otherwise equal, compare them by their title
if (left.data(Qt::InitialSortOrderRole) == right.data(Qt::InitialSortOrderRole))

This comment was marked as off-topic.

@lioncash
Copy link
Member

lioncash commented May 3, 2018

Gotta get that fat double approval in there apparently

@lioncash lioncash merged commit 54a6b0f into dolphin-emu:master May 3, 2018
@spycrab spycrab deleted the qt_sort_alpha branch May 3, 2018 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants