summaryrefslogtreecommitdiff
path: root/src/sysinfo.cpp
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-17 17:49:48 +0100
committerinfirit <[email protected]>2014-12-17 17:49:48 +0100
commit0dea7ab1931fb33f35eceab66dffcd56f4550f68 (patch)
tree5be2ef504b022c1801d8121f2c025cda49c60ce4 /src/sysinfo.cpp
parent7e751f28f66efe19b4abe427e0e08842ac352573 (diff)
downloadmate-system-monitor-0dea7ab1931fb33f35eceab66dffcd56f4550f68.tar.bz2
mate-system-monitor-0dea7ab1931fb33f35eceab66dffcd56f4550f68.tar.xz
Show CPU speed for ppc64 processors.
Taken from GSM commit: 401d84dc4ed6cc0cea3d23b19debfc6e9e204f90 From: Chris Kühl <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=619732
Diffstat (limited to 'src/sysinfo.cpp')
-rw-r--r--src/sysinfo.cpp15
1 files 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);
}
}