diff --git a/steam-runtime-tools/system-info.c b/steam-runtime-tools/system-info.c index 8136281f994e789b64f19d2bc5c88bd5bf29e733..c0061848a8db9869435c71cad48250997e932669 100644 --- a/steam-runtime-tools/system-info.c +++ b/steam-runtime-tools/system-info.c @@ -1655,6 +1655,24 @@ srt_system_info_get_steam_issues (SrtSystemInfo *self) return srt_steam_get_issues (self->steam_data); } +/** + * srt_system_info_get_steam_details: + * @self: The #SrtSystemInfo object + * + * Gather and return information about the Steam installation. + * + * Returns: (transfer full): An #SrtSteam object. Free with + * `g_object_unref ()`. + */ +SrtSteam * +srt_system_info_get_steam_details (SrtSystemInfo *self) +{ + g_return_val_if_fail (SRT_IS_SYSTEM_INFO (self), NULL); + + ensure_steam_cached (self); + return g_object_ref (self->steam_data); +} + /** * srt_system_info_dup_steam_installation_path: * @self: The #SrtSystemInfo object diff --git a/steam-runtime-tools/system-info.h b/steam-runtime-tools/system-info.h index 731d5d6227cad7450aafc3159ae760e04b4a9518..266ef0584ca3cceea7609af2cf006db3f8ac9b1c 100644 --- a/steam-runtime-tools/system-info.h +++ b/steam-runtime-tools/system-info.h @@ -165,6 +165,7 @@ gchar *srt_system_info_dup_runtime_path (SrtSystemInfo *self); gchar *srt_system_info_dup_runtime_version (SrtSystemInfo *self); SrtSteamIssues srt_system_info_get_steam_issues (SrtSystemInfo *self); +SrtSteam *srt_system_info_get_steam_details (SrtSystemInfo *self); gchar *srt_system_info_dup_steam_installation_path (SrtSystemInfo *self); gchar *srt_system_info_dup_steam_data_path (SrtSystemInfo *self); diff --git a/tests/system-info.c b/tests/system-info.c index 7905874e465197e00ead9b929631e92fd37c10ce..cd0ed810872a29657b11a6dc2cedc25dfc4c389a 100644 --- a/tests/system-info.c +++ b/tests/system-info.c @@ -733,6 +733,7 @@ steam_runtime (Fixture *f, SrtSystemInfo *info; SrtRuntimeIssues runtime_issues; SrtSteamIssues steam_issues; + SrtSteam *steam_details; gchar *runtime_path = NULL; gchar *installation_path = NULL; FakeHome *fake_home; @@ -764,13 +765,21 @@ steam_runtime (Fixture *f, /* Check for Steam issues */ steam_issues = srt_system_info_get_steam_issues (info); g_assert_cmpint (steam_issues, ==, SRT_STEAM_ISSUES_NONE); + steam_details = srt_system_info_get_steam_details (info); + steam_issues = srt_steam_get_issues (steam_details); + g_assert_cmpint (steam_issues, ==, SRT_STEAM_ISSUES_NONE); + g_object_unref (steam_details); /* Do the check again, this time using the cache */ steam_issues = srt_system_info_get_steam_issues (info); g_assert_cmpint (steam_issues, ==, SRT_STEAM_ISSUES_NONE); + steam_details = srt_system_info_get_steam_details (info); + steam_issues = srt_steam_get_issues (steam_details); + g_assert_cmpint (steam_issues, ==, SRT_STEAM_ISSUES_NONE); fake_home_clean_up (fake_home); g_object_unref (info); + g_object_unref (steam_details); g_free (runtime_path); g_free (installation_path); }