1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Merge branch 'master' into readline

This commit is contained in:
James Booth 2015-02-25 00:04:35 +00:00
commit a809dc9131
2 changed files with 17 additions and 31 deletions

View File

@ -100,30 +100,12 @@ prefs_load(void)
g_error_free(err);
}
// move pre 0.4.1 OTR preferences to [otr] group
// move pre 0.4.6 OTR warn preferences to [ui] group
err = NULL;
gboolean ui_otr_warn = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "otr.warn", &err);
gboolean otr_warn = g_key_file_get_boolean(prefs, PREF_GROUP_OTR, "warn", &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 == 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 == 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);
g_key_file_set_boolean(prefs, PREF_GROUP_UI, _get_key(PREF_OTR_WARN), otr_warn);
g_key_file_remove_key(prefs, PREF_GROUP_OTR, "warn", NULL);
} else {
g_error_free(err);
}
@ -531,6 +513,7 @@ _get_group(preference_t pref)
case PREF_ROSTER_BY:
case PREF_RESOURCE_TITLE:
case PREF_RESOURCE_MESSAGE:
case PREF_OTR_WARN:
case PREF_INPBLOCK_DYNAMIC:
return PREF_GROUP_UI;
case PREF_STATES:
@ -559,7 +542,6 @@ _get_group(preference_t pref)
case PREF_CONNECT_ACCOUNT:
case PREF_DEFAULT_ACCOUNT:
return PREF_GROUP_CONNECTION;
case PREF_OTR_WARN:
case PREF_OTR_LOG:
case PREF_OTR_POLICY:
return PREF_GROUP_OTR;
@ -648,7 +630,7 @@ _get_key(preference_t pref)
case PREF_OTR_LOG:
return "log";
case PREF_OTR_WARN:
return "warn";
return "otr.warn";
case PREF_OTR_POLICY:
return "policy";
case PREF_LOG_ROTATE:

View File

@ -421,20 +421,20 @@ _set_boolean_preference(char *prefstr, preference_t pref)
static void
_load_preferences(void)
{
_set_boolean_preference("intype", PREF_INTYPE);
_set_boolean_preference("beep", PREF_BEEP);
_set_boolean_preference("flash", PREF_FLASH);
_set_boolean_preference("privileges", PREF_MUC_PRIVILEGES);
_set_boolean_preference("presence", PREF_PRESENCE);
_set_boolean_preference("splash", PREF_SPLASH);
_set_boolean_preference("wrap", PREF_WRAP);
_set_string_preference("time", PREF_TIME);
_set_string_preference("statuses.muc", PREF_STATUSES_MUC);
_set_boolean_preference("resource.title", PREF_RESOURCE_TITLE);
_set_boolean_preference("resource.message", PREF_RESOURCE_MESSAGE);
_set_string_preference("statuses.console", PREF_STATUSES_CONSOLE);
_set_string_preference("statuses.chat", PREF_STATUSES_CHAT);
_set_string_preference("statuses.muc", PREF_STATUSES_MUC);
_set_boolean_preference("occupants", PREF_OCCUPANTS);
if (g_key_file_has_key(theme, "ui", "occupants.size", NULL)) {
gint occupants_size = g_key_file_get_integer(theme, "ui", "occupants.size", NULL);
prefs_set_occupants_size(occupants_size);
@ -444,12 +444,16 @@ _load_preferences(void)
_set_boolean_preference("roster.offline", PREF_ROSTER_OFFLINE);
_set_boolean_preference("roster.resource", PREF_ROSTER_RESOURCE);
_set_string_preference("roster.by", PREF_ROSTER_BY);
if (g_key_file_has_key(theme, "ui", "roster.size", NULL)) {
gint roster_size = g_key_file_get_integer(theme, "ui", "roster.size", NULL);
prefs_set_roster_size(roster_size);
}
_set_boolean_preference("privileges", PREF_MUC_PRIVILEGES);
_set_boolean_preference("presence", PREF_PRESENCE);
_set_boolean_preference("intype", PREF_INTYPE);
_set_boolean_preference("otr.warn", PREF_OTR_WARN);
}