diff options
Diffstat (limited to 'src/config/preferences.c')
-rw-r--r-- | src/config/preferences.c | 62 |
1 files changed, 10 insertions, 52 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index e4aebdb5..98ac5a0d 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -81,7 +81,6 @@ static const char* _get_group(preference_t pref); static const char* _get_key(preference_t pref); static gboolean _get_default_boolean(preference_t pref); static char* _get_default_string(preference_t pref); -static char** _get_default_string_list(preference_t pref); static void _prefs_load(void) @@ -171,7 +170,7 @@ _prefs_load(void) value = g_string_append(value, val); value = g_string_append(value, " %u;"); - g_key_file_set_locale_string(prefs, PREF_GROUP_EXECUTABLES, "url.open.cmd", "DEF", value->str); + g_key_file_set_locale_string(prefs, PREF_GROUP_EXECUTABLES, "url.open.cmd", "*", value->str); g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "urlopen.cmd", NULL); g_string_free(value, TRUE); @@ -183,6 +182,11 @@ _prefs_load(void) g_key_file_set_string(prefs, PREF_GROUP_EXECUTABLES, "avatar.cmd", value); g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "avatar.cmd", NULL); } + + // 0.10 will have omemo media sharing. so disabling of senfile introduced in 0.9 is not needed (#1270) + if (g_key_file_has_key(prefs, PREF_GROUP_OMEMO, "sendfile", NULL)) { + g_key_file_remove_key(prefs, PREF_GROUP_OMEMO, "sendfile", NULL); + } _save_prefs(); @@ -530,7 +534,7 @@ prefs_get_string_with_option(preference_t pref, gchar* option) if (result == NULL) { // check for user set default - result = g_key_file_get_locale_string(prefs, group, key, "DEF", NULL); + result = g_key_file_get_locale_string(prefs, group, key, "*", NULL); if (result == NULL) { if (def) { // use hardcoded profanity default @@ -544,33 +548,6 @@ prefs_get_string_with_option(preference_t pref, gchar* option) return result; } -gchar** -prefs_get_string_list_with_option(preference_t pref, gchar* option) -{ - const char* group = _get_group(pref); - const char* key = _get_key(pref); - char** def = _get_default_string_list(pref); - - gchar** result = g_key_file_get_locale_string_list(prefs, group, key, option, NULL, NULL); - if (result) { - g_strfreev(def); - return result; - } - - result = g_key_file_get_string_list(prefs, group, key, NULL, NULL); - if (result) { - g_strfreev(def); - return result; - } - - if (def) { - return def; - } else { - g_strfreev(def); - return NULL; - } -} - void prefs_set_string(preference_t pref, char* value) { @@ -1925,7 +1902,6 @@ _get_group(preference_t pref) return PREF_GROUP_PLUGINS; case PREF_OMEMO_LOG: case PREF_OMEMO_POLICY: - case PREF_OMEMO_SENDFILE: return PREF_GROUP_OMEMO; default: return NULL; @@ -2172,8 +2148,6 @@ _get_key(preference_t pref) return "log"; case PREF_OMEMO_POLICY: return "policy"; - case PREF_OMEMO_SENDFILE: - return "sendfile"; case PREF_CORRECTION_ALLOW: return "correction.allow"; case PREF_AVATAR_CMD: @@ -2321,26 +2295,10 @@ _get_default_string(preference_t pref) return "false"; case PREF_AVATAR_CMD: return "xdg-open"; - case PREF_URL_SAVE_CMD: - return "curl -o %p %u"; - default: - return NULL; - } -} - -// the default setting for a string list type preference -// if it is not specified in .profrc -static char** -_get_default_string_list(preference_t pref) -{ - char** str_array = NULL; - - switch (pref) { case PREF_URL_OPEN_CMD: - str_array = g_malloc0(3); - str_array[0] = g_strdup("false"); - str_array[1] = g_strdup("xdg-open %u"); - return str_array; + return "xdg-open %u"; + case PREF_URL_SAVE_CMD: + return NULL; // Default to built-in method. default: return NULL; } |