mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Qt/Resources: Convert int parameters of GetCountry(), GetPlatform() and GetMisc() to enum classes
Makes the parameter strongly-typed and doesn't accept arbitrary int values.
This commit is contained in:
@ -54,13 +54,13 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
case COL_PLATFORM:
|
||||
if (role == Qt::DecorationRole)
|
||||
return Resources::GetPlatform(static_cast<int>(game.GetPlatform()));
|
||||
return Resources::GetPlatform(game.GetPlatform());
|
||||
if (role == Qt::InitialSortOrderRole)
|
||||
return static_cast<int>(game.GetPlatform());
|
||||
break;
|
||||
case COL_COUNTRY:
|
||||
if (role == Qt::DecorationRole)
|
||||
return Resources::GetCountry(static_cast<int>(game.GetCountry()));
|
||||
return Resources::GetCountry(game.GetCountry());
|
||||
if (role == Qt::InitialSortOrderRole)
|
||||
return static_cast<int>(game.GetCountry());
|
||||
break;
|
||||
@ -70,7 +70,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||
// GameCube banners are 96x32, but Wii banners are 192x64.
|
||||
QPixmap banner = ToQPixmap(game.GetBannerImage());
|
||||
if (banner.isNull())
|
||||
banner = Resources::GetMisc(Resources::BANNER_MISSING);
|
||||
banner = Resources::GetMisc(Resources::MiscID::BannerMissing);
|
||||
|
||||
banner.setDevicePixelRatio(
|
||||
std::max(static_cast<qreal>(banner.width()) / GAMECUBE_BANNER_SIZE.width(),
|
||||
|
Reference in New Issue
Block a user