[gnome-initial-setup/youre-welcome: 8/10] Use GLib api to OS info




commit 1c6c8354c914db71b6946b4da1d777a0a31d8e84
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 6 08:17:28 2020 -0400

    Use GLib api to OS info
    
    Use g_get_os_info() to get the host OS name and version.
    This avoids the need for vendor.conf overrides.

 gnome-initial-setup/pages/welcome/gis-welcome-page.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.c 
b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
index d19856a7..a43d3938 100644
--- a/gnome-initial-setup/pages/welcome/gis-welcome-page.c
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
@@ -28,8 +28,6 @@
 #include "gis-welcome-page.h"
 #include "gis-assistant.h"
 
-#define VENDOR_WELCOME_GROUP "welcome"
-#define VENDOR_ENTITY_KEY "entity"
 
 struct _GisWelcomePage
 {
@@ -184,10 +182,15 @@ static void
 update_welcome_title (GisWelcomePage *page)
 {
   GisWelcomePagePrivate *priv = gis_welcome_page_get_instance_private (page);
-  g_autofree char *entity = gis_driver_conf_get_string (GIS_PAGE (page)->driver, VENDOR_WELCOME_GROUP, 
VENDOR_ENTITY_KEY);
+  g_autofree char *name = g_get_os_info (G_OS_INFO_KEY_NAME);
+  g_autofree char *entity = NULL;
   g_autofree char *text = NULL;
 
-  if (entity == NULL) {
+  if (name != NULL) {
+    g_autofree char *version = g_get_os_info (G_OS_INFO_KEY_VERSION_ID);
+    entity = g_strdup_printf ("%s %s", name, version);
+  }
+  else {
     g_autofree char *version = NULL;
     load_gnome_version (&version, NULL, NULL);
     entity = g_strdup_printf ("GNOME %s", version);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]