summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config/profiles.c17
-rw-r--r--src/config/profiles.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/config/profiles.c b/src/config/profiles.c
index 2829f56..04561ec 100644
--- a/src/config/profiles.c
+++ b/src/config/profiles.c
@@ -123,6 +123,23 @@ mq_profiles_set_color(MqProfiles *profiles, const gchar *profile,
g_key_file_set_string(profiles->key_file, profile, "color", color);
}
+void
+mq_profiles_set_default(MqProfiles *profiles, const gchar *profile)
+{
+ gchar **ids;
+ gsize length;
+ gsize i;
+
+ ids = g_key_file_get_groups(profiles->key_file, &length);
+ for (i = 0; i < length; ++i) {
+ g_key_file_set_boolean(profiles->key_file, ids[i], "default",
+ FALSE);
+ }
+ g_strfreev(ids);
+
+ g_key_file_set_boolean(profiles->key_file, profile, "default", FALSE);
+}
+
gboolean
mq_profiles_save(MqProfiles *profiles)
{
diff --git a/src/config/profiles.h b/src/config/profiles.h
index fce5209..0159461 100644
--- a/src/config/profiles.h
+++ b/src/config/profiles.h
@@ -51,6 +51,9 @@ void
mq_profiles_set_color(MqProfiles *profiles, const gchar *profile,
const gchar *color);
+void
+mq_profiles_set_default(MqProfiles *profiles, const gchar *profile);
+
gboolean
mq_profiles_save(MqProfiles *profiles);