diff options
| author | Rachel Bryk <RachelBryk@gmail.com> | 2015-03-07 04:26:04 -0500 |
|---|---|---|
| committer | Rachel Bryk <RachelBryk@gmail.com> | 2015-03-07 05:17:46 -0500 |
| commit | 11b437ffd17d85a8fea22cf9df08d85b8d1105cd (patch) | |
| tree | cc68cbaae2e46e957b6d6f04b32d250d32130fcb | |
| parent | a3f6cbfe6b6320439ea1770ccd6704048eb06c69 (diff) | |
Consistently sort games with the same name but different revision or region.
| -rw-r--r-- | Source/Core/DolphinWX/GameListCtrl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index b7185f014e..f5c32d3719 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -128,10 +128,12 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is case CGameListCtrl::COLUMN_TITLE: if (!strcasecmp(iso1->GetName(indexOne).c_str(),iso2->GetName(indexOther).c_str())) { - if (iso1->IsDiscTwo()) - return 1 * t; - else if (iso2->IsDiscTwo()) - return -1 * t; + if (iso1->GetUniqueID() != iso2->GetUniqueID()) + return t * (iso1->GetUniqueID() > iso2->GetUniqueID() ? 1 : -1); + if (iso1->GetRevision() != iso2->GetRevision()) + return t * (iso1->GetRevision() > iso2->GetRevision() ? 1 : -1); + if (iso1->IsDiscTwo() != iso2->IsDiscTwo()) + return t * iso1->IsDiscTwo() ? 1 : -1; } return strcasecmp(iso1->GetName(indexOne).c_str(), iso2->GetName(indexOther).c_str()) * t; |
