patch_manager: fix owned games o. for all versions

This commit is contained in:
Megamouse 2020-06-28 15:16:09 +02:00
parent a5368d766a
commit ef203f6bcb
5 changed files with 19 additions and 12 deletions

View File

@ -1946,20 +1946,13 @@ void game_list_frame::PopulateGameList()
}
// Version
QString app_version = qstr(game->info.app_ver);
const QString unknown = localized.category.unknown;
if (app_version == unknown)
{
// Fall back to Disc/Pkg Revision
app_version = qstr(game->info.version);
}
QString app_version = qstr(GetGameVersion(game));
if (game->info.bootable && !game->compat.latest_version.isEmpty())
{
// If the app is bootable and the compat database contains info about the latest patch version:
// add a hint for available software updates if the app version is unknown or lower than the latest version.
if (app_version == unknown || game->compat.latest_version.toDouble() > app_version.toDouble())
if (app_version == localized.category.unknown || game->compat.latest_version.toDouble() > app_version.toDouble())
{
app_version = tr("%0 (Update available: %1)").arg(app_version, game->compat.latest_version);
}
@ -2235,3 +2228,14 @@ QList<game_info> game_list_frame::GetGameInfo() const
{
return m_game_data;
}
std::string game_list_frame::GetGameVersion(const game_info& game)
{
if (game->info.app_ver == sstr(Localized().category.unknown))
{
// Fall back to Disc/Pkg Revision
return game->info.version;
}
return game->info.app_ver;
}

View File

@ -71,6 +71,9 @@ public:
QList<game_info> GetGameInfo() const;
// Returns the visible version string in the game list
static std::string GetGameVersion(const game_info& game);
public Q_SLOTS:
void BatchCreatePPUCaches();
void BatchRemovePPUCaches();

View File

@ -1542,7 +1542,7 @@ void main_window::CreateConnects()
{
if (game)
{
games[game->info.serial].insert(game->info.app_ver);
games[game->info.serial].insert(game_list_frame::GetGameVersion(game));
}
}
}

View File

@ -332,7 +332,7 @@ void patch_manager_dialog::filter_patches(const QString& term)
const std::string app_version = item->data(0, app_version_role).toString().toStdString();
if (serial != patch_key::all &&
(m_owned_games.find(serial) == m_owned_games.end() || !m_owned_games.at(serial).contains(app_version)))
(m_owned_games.find(serial) == m_owned_games.end() || (app_version != patch_key::all && !m_owned_games.at(serial).contains(app_version))))
{
item->setHidden(true);
return 0;

View File

@ -121,7 +121,7 @@
<item>
<widget class="QGroupBox" name="gb_app_version">
<property name="title">
<string>App Version</string>
<string>Game Version</string>
</property>
<layout class="QVBoxLayout" name="layout_app_version">
<item>