summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/schemes/about/profiles.c23
1 files changed, 15 insertions, 8 deletions
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_");