about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/preferences.c34
-rw-r--r--src/config/preferences.h3
-rw-r--r--src/config/theme.c10
3 files changed, 47 insertions, 0 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index 4fd96381..d93854cc 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -750,6 +750,40 @@ prefs_get_occupants_size(void)
     }
 }
 
+char
+prefs_get_occupants_char(void)
+{
+    char result = 0;
+
+    char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.char", NULL);
+    if (!resultstr) {
+        result =  0;
+    } else {
+        result = resultstr[0];
+    }
+    free(resultstr);
+
+    return result;
+}
+
+void
+prefs_set_occupants_char(char ch)
+{
+    char str[2];
+    str[0] = ch;
+    str[1] = '\0';
+
+    g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.char", str);
+    _save_prefs();
+}
+
+void
+prefs_clear_occupants_char(void)
+{
+    g_key_file_remove_key(prefs, PREF_GROUP_UI, "occupants.char", NULL);
+    _save_prefs();
+}
+
 gint
 prefs_get_occupants_indent(void)
 {
diff --git a/src/config/preferences.h b/src/config/preferences.h
index 5bc82dc9..108111c8 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -240,6 +240,9 @@ void prefs_clear_roster_room_char(void);
 char prefs_get_roster_room_private_char(void);
 void prefs_set_roster_room_private_char(char ch);
 void prefs_clear_roster_room_private_char(void);
+char prefs_get_occupants_char(void);
+void prefs_set_occupants_char(char ch);
+void prefs_clear_occupants_char(void);
 char prefs_get_occupants_header_char(void);
 void prefs_set_occupants_header_char(char ch);
 void prefs_clear_occupants_header_char(void);
diff --git a/src/config/theme.c b/src/config/theme.c
index 8d8061e9..a0ca8356 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -453,6 +453,16 @@ _load_preferences(void)
         prefs_set_occupants_size(occupants_size);
     }
 
+    if (g_key_file_has_key(theme, "ui", "occupants.char", NULL)) {
+        gchar *ch = g_key_file_get_string(theme, "ui", "occupants.char", NULL);
+        if (ch && strlen(ch) > 0) {
+            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)) {
         gint occupants_indent = g_key_file_get_integer(theme, "ui", "occupants.indent", NULL);
         prefs_set_occupants_indent(occupants_indent);