diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/schemes/about/profiles.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/schemes/about/profiles.c b/src/schemes/about/profiles.c index d2a5e21..eea34d1 100644 --- a/src/schemes/about/profiles.c +++ b/src/schemes/about/profiles.c @@ -363,24 +363,20 @@ edit_profiles(MqProfiles *profiles, GHashTable *query) for (key = keys; key; key = key->next) { if (g_str_has_prefix(key->data, "save_")) { id = (gchar *) key->data + strlen("save_"); + name_key = g_strconcat("name_", id, NULL); + color_key = g_strconcat("color_", id, NULL); if (id[0]) { /* Edit existing profile. */ - 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, name_key)); mq_profiles_set_color(profiles, id, g_hash_table_lookup(query, color_key)); - g_free(name_key); - g_free(color_key); } else { - name_key = g_strconcat("name_", id, NULL); - color_key = g_strconcat("color_", id, NULL); mq_profiles_insert(profiles, g_hash_table_lookup(query, name_key), g_hash_table_lookup(query, color_key)); - g_free(name_key); - g_free(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_"); if (id[0]) { /* Don't remove new profile. */ |