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
Conversation
| @@ -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.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| if (sortOrder() == Qt::AscendingOrder) | ||
| return leftTitle < rightTitle; | ||
| else |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| if (sortOrder() == Qt::AscendingOrder) | ||
| return QSortFilterProxyModel::lessThan(left, right); | ||
| else |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| // 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.
This comment was marked as off-topic.
Sorry, something went wrong.
| 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.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Gotta get that fat double approval in there apparently |
Even when sorting by another column (e.g. Platform) an alphabetical order within that sorting must be upheld.