From 1cb1d14d0cd12279737510973cc8c3e881b0db5d Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 15 Feb 2020 10:24:35 +0100 Subject: [PATCH] Qt: only add version update hint to bootable applications --- rpcs3/rpcs3qt/game_compatibility.cpp | 4 ++-- rpcs3/rpcs3qt/game_compatibility.h | 2 +- rpcs3/rpcs3qt/game_list_frame.cpp | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rpcs3/rpcs3qt/game_compatibility.cpp b/rpcs3/rpcs3qt/game_compatibility.cpp index 1ef3acb612..f0cfa8707a 100644 --- a/rpcs3/rpcs3qt/game_compatibility.cpp +++ b/rpcs3/rpcs3qt/game_compatibility.cpp @@ -75,8 +75,8 @@ bool game_compatibility::ReadJSON(const QJsonObject& json_data, bool after_downl // Add date if possible status.date = json_result.value("date").toString(); - // Add version if possible - status.version = json_result.value("update").toString(); + // Add latest version if possible + status.latest_version = json_result.value("update").toString(); // Add status to map m_compat_database.emplace(std::pair(sstr(key), status)); diff --git a/rpcs3/rpcs3qt/game_compatibility.h b/rpcs3/rpcs3qt/game_compatibility.h index ebf83f35cc..0d73eb65ce 100644 --- a/rpcs3/rpcs3qt/game_compatibility.h +++ b/rpcs3/rpcs3qt/game_compatibility.h @@ -22,7 +22,7 @@ struct compat_status QString color; QString text; QString tooltip; - QString version; + QString latest_version; }; class game_compatibility : public QObject diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index e7e70858b9..02c4c38f64 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -1980,16 +1980,22 @@ int game_list_frame::PopulateGameList() // Version QString app_version = qstr(game->info.app_ver); + const QString unknown = localized.category.unknown; - if (app_version == localized.category.unknown) + if (app_version == unknown) { // Fall back to Disc/Pkg Revision app_version = qstr(game->info.version); } - if (!game->compat.version.isEmpty() && (app_version == localized.category.unknown || game->compat.version.toDouble() > app_version.toDouble())) + if (game->info.bootable && !game->compat.latest_version.isEmpty()) { - app_version = tr("%0 (Update available: %1)").arg(app_version, game->compat.version); + // 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()) + { + app_version = tr("%0 (Update available: %1)").arg(app_version, game->compat.latest_version); + } } // Playtimes