From 82fea8671746e0b6e33d31792e50571f4039398d Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Tue, 20 Aug 2019 19:57:33 +0800 Subject: [PATCH] citra_qt/game_list: Add an All Regions check Some titles (mostly homebrews) do not use the region free value 0x7FFF but instead set all of the region flags, resulting in all regions displayed in game list, which is not beautiful and not what we want. This fixes it by adding an all_regions check. --- src/citra_qt/game_list_p.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/citra_qt/game_list_p.h b/src/citra_qt/game_list_p.h index 5891a4487..9a3fef612 100644 --- a/src/citra_qt/game_list_p.h +++ b/src/citra_qt/game_list_p.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -95,6 +96,14 @@ static QString GetRegionFromSMDH(const Loader::SMDH& smdh) { return QObject::tr("Region free"); } + const bool all_regions = + std::all_of(regions_map.begin(), regions_map.end(), [®ions](const auto& it) { + return std::find(regions.begin(), regions.end(), it.first) != regions.end(); + }); + if (all_regions) { + return QObject::tr("All regions"); + } + QString result = QObject::tr(regions_map.at(regions.front())); for (auto region = ++regions.begin(); region != regions.end(); ++region) { result += QStringLiteral("\n") + QObject::tr(regions_map.at(*region));