Use g_get_os_info()
The welcome page, privacy page and summary page all include their own copy-pasted code to parse fields from /etc/os-release
.
GLib 2.63.1 and newer include a new function, g_get_os_info()
, which can be used to parse this file and retrieve keys from it. Both pages should be adjusted to use it. Here is a blog post heralding its introduction..
The necessary changes should be straightforward:
- Ensure you have a new-enough GLib available to develop against
- Bump the dependency in
meson.build
- Delete lots of code in
gis-welcome-page.c
,gis-privacy-page.c
andgis-summary-page.c
, replacing each with 1-2 lines to callg_get_os_info()
Edited by Will Thompson