[gnome-system-monitor] Temporary workaround for CPU with more than 4 cores
- From: Chris Kühl <chriskuehl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Temporary workaround for CPU with more than 4 cores
- Date: Sun, 3 Apr 2011 19:04:31 +0000 (UTC)
commit bb8c0a89cae435ad12734c2d8fca3a16f94a26bf
Author: Marc-Antoine Perennou <Marc-Antoine Perennou com>
Date: Fri Mar 25 18:11:21 2011 +0100
Temporary workaround for CPU with more than 4 cores
We do not provide colors after cpu-color3 in the schema
Use only the 4 colors from the scheme for now
https://bugzilla.gnome.org/show_bug.cgi?id=645662
src/callbacks.cpp | 2 +-
src/procman.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/callbacks.cpp b/src/callbacks.cpp
index ce77d70..7b4d383 100644
--- a/src/callbacks.cpp
+++ b/src/callbacks.cpp
@@ -237,7 +237,7 @@ cb_cpu_color_changed (GSMColorButton *cp, gpointer data)
gint i = GPOINTER_TO_INT (data);
GSettings *settings = g_settings_new (GSM_GSETTINGS_SCHEMA);
- g_snprintf(key, sizeof key, "cpu-color%d", i);
+ g_snprintf(key, sizeof key, "cpu-color%d", i%4);
change_settings_color(settings, key, cp);
}
diff --git a/src/procman.cpp b/src/procman.cpp
index 9b9292a..daebdc7 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -181,7 +181,7 @@ color_changed_cb (GSettings *settings, const gchar *key, gpointer data)
if (g_str_has_prefix (key, "cpu-color")) {
for (int i = 0; i < procdata->config.num_cpus; i++) {
- string cpu_key = make_string(g_strdup_printf("cpu-color%d", i));
+ string cpu_key = make_string(g_strdup_printf("cpu-color%d", i%4));
if (cpu_key == key) {
gdk_color_parse (color, &procdata->config.cpu_color[i]);
procdata->cpu_graph->colors.at(i) = procdata->config.cpu_color[i];
@@ -279,7 +279,7 @@ procman_data_new (GSettings *settings)
for (int i = 0; i < pd->config.num_cpus; i++) {
gchar *key;
- key = g_strdup_printf ("cpu-color%d", i);
+ key = g_strdup_printf ("cpu-color%d", i%4);
color = g_settings_get_string (settings, key);
if (!color)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]