From 0dea7ab1931fb33f35eceab66dffcd56f4550f68 Mon Sep 17 00:00:00 2001
From: infirit <infirit@gmail.com>
Date: Wed, 17 Dec 2014 17:49:48 +0100
Subject: Show CPU speed for ppc64 processors.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Taken from GSM commit: 401d84dc4ed6cc0cea3d23b19debfc6e9e204f90
From: Chris Kühl <chrisk@openismus.com>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=619732
---
 src/sysinfo.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 6e7ce54..c24acb1 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -106,16 +106,25 @@ namespace {
 
       for (guint i = 0; i != info->ncpu; ++i) {
 	const char * const keys[] = { "model name", "cpu", "Processor" };
-	gchar *model = 0;
+	gchar *model = 0, *clock = 0;
+	guint last;
 
-	for (guint j = 0; !model && j != G_N_ELEMENTS(keys); ++j)
+	for (guint j = 0; !model && j != G_N_ELEMENTS(keys); ++j) {
+	  last = j;
 	  model = static_cast<char*>(g_hash_table_lookup(info->cpuinfo[i].values,
 							 keys[j]));
+	}
 
 	if (!model)
 	  continue;
 
-	this->processors.push_back(model);
+	if (!strcmp(keys[last], "cpu"))
+	  clock = static_cast<char*>(g_hash_table_lookup(info->cpuinfo[i].values,
+							 "clock"));
+	if (clock)
+	  this->processors.push_back(string(model) + " " + string(clock));
+	else
+	  this->processors.push_back(model);
       }
     }
 
-- 
cgit v1.2.1