[haiku-commits] r41480 - haiku/trunk/src/apps/aboutsystem

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 13 May 2011 22:38:19 +0200 (CEST)

Author: zooey
Date: 2011-05-13 22:38:19 +0200 (Fri, 13 May 2011)
New Revision: 41480
Changeset: https://dev.haiku-os.org/changeset/41480

Modified:
   haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp
   haiku/trunk/src/apps/aboutsystem/Jamfile
Log:
* adjust AboutSystem to fetch the system revision via
  get_system_revision() instead of parsing it from utsname

Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp
===================================================================
--- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp    2011-05-13 20:38:14 UTC 
(rev 41479)
+++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp    2011-05-13 20:38:19 UTC 
(rev 41480)
@@ -11,7 +11,6 @@
 
 #include <ctype.h>
 #include <stdio.h>
-#include <sys/utsname.h>
 #include <time.h>
 #include <unistd.h>
 
@@ -47,6 +46,7 @@
 #include <AppMisc.h>
 #include <AutoDeleter.h>
 #include <cpu_type.h>
+#include <system_revision.h>
 
 #include <Catalog.h>
 #include <Language.h>
@@ -541,19 +541,14 @@
                        strlcpy(string, versionInfo.short_info, sizeof(string));
        }
 
-       // Add revision from uname() info
-       utsname unameInfo;
-       if (uname(&unameInfo) == 0) {
-               long revision;
-               if (sscanf(unameInfo.version, "r%ld", &revision) == 1) {
-                       char version[16];
-                       snprintf(version, sizeof(version), "%ld", revision);
-                       strlcat(string, " (", sizeof(string));
-                       strlcat(string, B_TRANSLATE("Revision"), 
sizeof(string));
-                       strlcat(string, " ", sizeof(string));
-                       strlcat(string, version, sizeof(string));
-                       strlcat(string, ")", sizeof(string));
-               }
+       // Add system revision
+       const char* haikuRevision = get_system_revision();
+       if (haikuRevision != NULL) {
+               strlcat(string, " (", sizeof(string));
+               strlcat(string, B_TRANSLATE("Revision"), sizeof(string));
+               strlcat(string, " ", sizeof(string));
+               strlcat(string, haikuRevision, sizeof(string));
+               strlcat(string, ")", sizeof(string));
        }
 
        BStringView* versionView = new BStringView("ostext", string);

Modified: haiku/trunk/src/apps/aboutsystem/Jamfile
===================================================================
--- haiku/trunk/src/apps/aboutsystem/Jamfile    2011-05-13 20:38:14 UTC (rev 
41479)
+++ haiku/trunk/src/apps/aboutsystem/Jamfile    2011-05-13 20:38:19 UTC (rev 
41480)
@@ -1,6 +1,6 @@
 SubDir HAIKU_TOP src apps aboutsystem ;
 
-UsePrivateHeaders app shared ;
+UsePrivateHeaders app shared system ;
 
 Application AboutSystem :
        AboutSystem.cpp


Other related posts:

  • » [haiku-commits] r41480 - haiku/trunk/src/apps/aboutsystem - zooey