diff options
-rw-r--r-- | src/config/profiles.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config/profiles.c b/src/config/profiles.c index dbd4e29..28a66f8 100644 --- a/src/config/profiles.c +++ b/src/config/profiles.c @@ -150,8 +150,14 @@ mq_profiles_get_default(MqProfiles *profiles) ids = g_key_file_get_groups(profiles->key_file, &length); for (i = 0; i < length; ++i) { + if (i == 0) { + /* In case no profile is marked as default, use the + * first one. */ + def = g_strdup(ids[i]); + } if (g_key_file_get_boolean(profiles->key_file, ids[i], "default", NULL)) { + g_free(def); def = g_strdup(ids[i]); break; } |