summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-06 16:01:19 (EST)
committer Patrick McDermott <pj@pehjota.net>2017-11-06 16:01:19 (EST)
commit1f12d146cedbd513456b563ec288ac56a986d8ca (patch)
treee4e24cd5dc0418e70e428a8a27cedf084913de85
parent77f157ec232e612e5aa802dc75886c33d166592a (diff)
downloadmarquee-1f12d146cedbd513456b563ec288ac56a986d8ca.zip
marquee-1f12d146cedbd513456b563ec288ac56a986d8ca.tar.gz
marquee-1f12d146cedbd513456b563ec288ac56a986d8ca.tar.bz2
src/config/profiles.c: Set default profile after all insertions
-rw-r--r--src/config/profiles.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/config/profiles.c b/src/config/profiles.c
index aca758b..f80a6a7 100644
--- a/src/config/profiles.c
+++ b/src/config/profiles.c
@@ -39,7 +39,8 @@ create(MqProfiles *profiles)
{
GFile *file;
GFileOutputStream *stream;
- gchar *profile;
+ gchar *default_profile;
+ gchar *private_profile;
file = g_file_new_for_path(profiles->file_name);
@@ -48,13 +49,11 @@ create(MqProfiles *profiles)
return FALSE;
}
- profile = mq_profiles_insert(profiles, "Default", "#0000ff");
- mq_profiles_set_default(profiles, profile);
- g_free(profile);
-
- profile = mq_profiles_insert(profiles, "Private", "#6060a0");
- g_free(profile);
-
+ default_profile = mq_profiles_insert(profiles, "Default", "#0000ff");
+ private_profile = mq_profiles_insert(profiles, "Private", "#6060a0");
+ mq_profiles_set_default(profiles, default_profile);
+ g_free(default_profile);
+ g_free(private_profile);
mq_profiles_save(profiles);
/* TODO: Create configs. */