From 92c8366880bd1617d91e1d38c13ed94b9e0279f3 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 20 Dec 2019 10:45:25 +0100 Subject: [PATCH] Dont kill *.char preferences if theme doesnt contain it So far `/occupants char *`, `/roster contact char *`, `/roster room char #`, `/roster header char -`, `/occupants header char -` was saved and loaded from the preferences. But was overwritten when the theme was loaded. If the theme didn't set these values the value was just cleared. Despite that it might have been set in the users preferences. Funny enough the themes don't operate generally like this. For example `otr.char` is not cleared. This is again due to our borked theme/prefs concept (https://github.com/profanity-im/profanity/issues/1077). For now let's just use the one set from the preferences if it's set. The theme will however overwrite it if it is set there. Fix https://github.com/profanity-im/profanity/issues/1244 --- src/config/theme.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/config/theme.c b/src/config/theme.c index 48776090..424a14a3 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -361,8 +361,6 @@ _load_preferences(void) prefs_set_occupants_char(ch[0]); g_free(ch); } - } else { - prefs_clear_occupants_char(); } if (g_key_file_has_key(theme, "ui", "occupants.indent", NULL)) { @@ -376,8 +374,6 @@ _load_preferences(void) prefs_set_occupants_header_char(ch[0]); g_free(ch); } - } else { - prefs_clear_occupants_header_char(); } if (g_key_file_has_key(theme, "ui", "roster.size", NULL)) { @@ -391,8 +387,6 @@ _load_preferences(void) prefs_set_roster_header_char(ch[0]); g_free(ch); } - } else { - prefs_clear_roster_header_char(); } if (g_key_file_has_key(theme, "ui", "roster.contact.char", NULL)) { @@ -401,8 +395,6 @@ _load_preferences(void) prefs_set_roster_contact_char(ch[0]); g_free(ch); } - } else { - prefs_clear_roster_contact_char(); } if (g_key_file_has_key(theme, "ui", "roster.resource.char", NULL)) { @@ -421,8 +413,6 @@ _load_preferences(void) prefs_set_roster_room_char(ch[0]); g_free(ch); } - } else { - prefs_clear_roster_room_char(); } if (g_key_file_has_key(theme, "ui", "roster.rooms.private.char", NULL)) { @@ -431,8 +421,6 @@ _load_preferences(void) prefs_set_roster_room_private_char(ch[0]); g_free(ch); } - } else { - prefs_clear_roster_room_private_char(); } if (g_key_file_has_key(theme, "ui", "roster.private.char", NULL)) { @@ -441,8 +429,6 @@ _load_preferences(void) prefs_set_roster_private_char(ch[0]); g_free(ch); } - } else { - prefs_clear_roster_private_char(); } if (g_key_file_has_key(theme, "ui", "roster.contact.indent", NULL)) {