1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

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
This commit is contained in:
Michael Vetter 2019-12-20 10:45:25 +01:00
parent e904b000ad
commit 92c8366880

View File

@ -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)) {