aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-02 10:59:45 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-02 10:59:45 +0200
commit6ada720e182f48a929d0f1b169f02b49a65d60ec (patch)
treef57edb6acccd6c8f6b72ed72ac7a9f29835aea8e /src
parent7de83217c4d7bfdb70b77f2baeb8f12d4147d873 (diff)
downloadprofani-tty-6ada720e182f48a929d0f1b169f02b49a65d60ec.tar.gz
executable: actually take the user set default if a certain scheme is
not found
Diffstat (limited to 'src')
-rw-r--r--src/config/preferences.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index bab53000..7fff766d 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -526,14 +526,19 @@ prefs_get_string_with_option(preference_t pref, gchar *option)
char *result = g_key_file_get_locale_string(prefs, group, key, option, NULL);
if (result == NULL) {
- if (def) {
- return g_strdup(def);
- } else {
- return NULL;
+ // check for user set default
+ result = g_key_file_get_locale_string(prefs, group, key, "DEF", NULL);
+ if (result == NULL) {
+ if (def) {
+ // use hardcoded profanity default
+ return g_strdup(def);
+ } else {
+ return NULL;
+ }
}
- } else {
- return result;
}
+
+ return result;
}
gchar**