[gnome-control-center] info: show build-id



commit 6052e469a957203f5e339c44f828349b417679b8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Jul 11 14:39:05 2016 -0300

    info: show build-id
    
    While developing, it's useful to show the build id of the
    installed OS when available, which the info panel doesn't
    handle for now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768693

 panels/info/cc-info-panel.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index d6c47b0..79729dd 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -455,7 +455,7 @@ static char *
 get_os_type (void)
 {
   GHashTable *os_info;
-  gchar *name, *result;
+  gchar *name, *result, *build_id;
   int bits;
 
   os_info = get_os_info ();
@@ -464,19 +464,34 @@ get_os_type (void)
     return NULL;
 
   name = g_hash_table_lookup (os_info, "PRETTY_NAME");
+  build_id = g_hash_table_lookup (os_info, "BUILD_ID");
 
   if (GLIB_SIZEOF_VOID_P == 8)
     bits = 64;
   else
     bits = 32;
 
-  /* translators: This is the name of the OS, followed by the type
-   * of architecture, for example:
-   * "Fedora 18 (Spherical Cow) 64-bit" or "Ubuntu (Oneric Ocelot) 32-bit" */
-  if (name)
-    result = g_strdup_printf (_("%s %d-bit"), name, bits);
+  if (build_id)
+    {
+      /* translators: This is the name of the OS, followed by the type
+       * of architecture and the build id, for example:
+       * "Fedora 18 (Spherical Cow) 64-bit (Build ID: xyz)" or
+       * "Ubuntu (Oneric Ocelot) 32-bit (Build ID: jki)" */
+      if (name)
+        result = g_strdup_printf (_("%s %d-bit (Build ID: %s)"), name, bits, build_id);
+      else
+        result = g_strdup_printf (_("%d-bit (Build ID: %s)"), bits, build_id);
+    }
   else
-    result = g_strdup_printf (_("%d-bit"), bits);
+    {
+      /* translators: This is the name of the OS, followed by the type
+       * of architecture, for example:
+       * "Fedora 18 (Spherical Cow) 64-bit" or "Ubuntu (Oneric Ocelot) 32-bit" */
+      if (name)
+        result = g_strdup_printf (_("%s %d-bit"), name, bits);
+      else
+        result = g_strdup_printf (_("%d-bit"), bits);
+    }
 
   g_clear_pointer (&os_info, g_hash_table_destroy);
 


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