diff options
-rw-r--r-- | src/config/preferences.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index 6c41cdfa..7acd5a0d 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -82,22 +82,31 @@ prefs_load(void) // move pre 0.4.1 OTR preferences to [otr] group err = NULL; gboolean ui_otr_warn = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "otr.warn", &err); - if (!err) { + if (err == NULL) { g_key_file_set_boolean(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_WARN), ui_otr_warn); g_key_file_remove_key(prefs, PREF_GROUP_UI, "otr.warn", NULL); + } else { + g_error_free(err); } + err = NULL; gchar *ui_otr_log = g_key_file_get_string(prefs, PREF_GROUP_LOGGING, "otr", &err); - if (!err) { + if (err == NULL) { g_key_file_set_string(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_LOG), ui_otr_log); g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "otr", NULL); + } else { + g_error_free(err); } + err = NULL; gchar *ui_otr_policy = g_key_file_get_string(prefs, "policy", "otr.policy", &err); - if (!err) { + if (err == NULL) { g_key_file_set_string(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_POLICY), ui_otr_policy); g_key_file_remove_group(prefs, "policy", NULL); + } else { + g_error_free(err); } + _save_prefs(); boolean_choice_ac = autocomplete_new(); |