summaryrefslogtreecommitdiff
path: root/src/procman.cpp
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-01-04 02:50:21 -0800
committerStefano Karapetsas <[email protected]>2013-01-04 02:50:21 -0800
commit6c8240e5611355fdf8f69ab603c0113a2840000b (patch)
treec44c8660e3428de47943b34bce06d5adb48ab348 /src/procman.cpp
parent99a70e0dac224bf34ab2753bafc1344c04991b2a (diff)
parent781618080e373211921222bef4696fe9ce3edd61 (diff)
downloadmate-system-monitor-6c8240e5611355fdf8f69ab603c0113a2840000b.tar.bz2
mate-system-monitor-6c8240e5611355fdf8f69ab603c0113a2840000b.tar.xz
Merge pull request #16 from sbalneav/master
Paint it black
Diffstat (limited to 'src/procman.cpp')
-rw-r--r--src/procman.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/procman.cpp b/src/procman.cpp
index 9c683ef..dc0c9ea 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -66,6 +66,18 @@ ProcData* ProcData::get_instance()
return &instance;
}
+static gboolean
+has_key (gchar **keys, const gchar *key)
+{
+ gchar **loop = keys;
+
+ while (*loop) {
+ if (!strcmp (*loop++, key))
+ return TRUE;
+ }
+
+ return FALSE;
+}
static void
tree_changed_cb (GSettings *settings, const gchar *key, gpointer data)
@@ -177,7 +189,15 @@ static void
color_changed_cb (GSettings *settings, const gchar *key, gpointer data)
{
ProcData * const procdata = static_cast<ProcData*>(data);
- const gchar *color = g_settings_get_string (settings, key);
+ gchar **keys;
+ gchar *color = NULL;
+
+ keys = g_settings_list_keys (settings);
+ if (has_key (keys, key))
+ color = g_settings_get_string (settings, key);
+ else
+ color = g_strdup("#000000"); /* black default color */
+ g_strfreev (keys);
if (g_str_has_prefix (key, "cpu-color")) {
for (int i = 0; i < procdata->config.num_cpus; i++) {
@@ -701,8 +721,7 @@ main (int argc, char *argv[])
exit (0);
}
- /* initialize rsvg */
- rsvg_init ();
+ g_type_init ();
gtk_window_set_default_icon_name ("utilities-system-monitor");
g_set_application_name(_("System Monitor"));
@@ -741,10 +760,6 @@ main (int argc, char *argv[])
glibtop_close ();
- // This function should only be called just before program exit.
- // See MATE bug #592100 for a discussion about this.
- rsvg_term ();
-
return 0;
}