From ad70ffabf7f6735b8bcde13fa30a1bd1dc83aec5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 06 Nov 2017 14:56:26 -0500 Subject: about:profiles: Set profile colors --- diff --git a/src/schemes/about/profiles.c b/src/schemes/about/profiles.c index 0e7d804..d2a5e21 100644 --- a/src/schemes/about/profiles.c +++ b/src/schemes/about/profiles.c @@ -355,7 +355,8 @@ edit_profiles(MqProfiles *profiles, GHashTable *query) GList *keys; GList *key; gchar *id; - gchar *input_key; + gchar *name_key; + gchar *color_key; keys = g_hash_table_get_keys(query); @@ -363,16 +364,22 @@ edit_profiles(MqProfiles *profiles, GHashTable *query) if (g_str_has_prefix(key->data, "save_")) { id = (gchar *) key->data + strlen("save_"); if (id[0]) { /* Edit existing profile. */ - input_key = g_strconcat("name_", id, NULL); + name_key = g_strconcat("name_", id, NULL); + color_key = g_strconcat("color_", id, NULL); mq_profiles_set_name(profiles, id, - g_hash_table_lookup(query, input_key)); - g_free(input_key); + g_hash_table_lookup(query, name_key)); + mq_profiles_set_color(profiles, id, + g_hash_table_lookup(query, color_key)); + g_free(name_key); + g_free(color_key); } else { - input_key = g_strconcat("name_", id, NULL); + name_key = g_strconcat("name_", id, NULL); + color_key = g_strconcat("color_", id, NULL); mq_profiles_insert(profiles, - g_hash_table_lookup(query, input_key), - "#00ff00"); - g_free(input_key); + g_hash_table_lookup(query, name_key), + g_hash_table_lookup(query, color_key)); + g_free(name_key); + g_free(color_key); } } else if (g_str_has_prefix(key->data, "delete_")) { id = (gchar *) key->data + strlen("delete_"); -- cgit v0.9.1