diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-11-01 18:24:35 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-11-25 01:29:44 +0800 |
commit | 1af4342a53358f23f71fabd0012a0d868a13c194 (patch) | |
tree | b6e2c27d5b1109bd901af7c8a442012541e1816a /libempathy-gtk/empathy-theme-adium.c | |
parent | 1d42b9fde60750fab76d7af606388bc28b1083ad (diff) | |
download | gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.tar gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.tar.gz gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.tar.bz2 gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.tar.lz gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.tar.xz gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.tar.zst gsoc2013-empathy-1af4342a53358f23f71fabd0012a0d868a13c194.zip |
Optimisation: Do not fetch use-smiley gconf key for each substring.
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index f1da329e3..5aae85c4a 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -216,18 +216,15 @@ theme_adium_parser_newline (GString *string, empathy_string_parser_substr (string, text + prev, i - prev, user_data); } +static gboolean use_smileys = FALSE; + static void theme_adium_parser_smiley (GString *string, const gchar *text, gssize len, gpointer user_data) { - gboolean use_smileys = FALSE; - gint last = 0; - - empathy_conf_get_bool (empathy_conf_get (), - EMPATHY_PREFS_CHAT_SHOW_SMILEYS, - &use_smileys); + gint last = 0; if (use_smileys) { EmpathySmileyManager *smiley_manager; @@ -281,6 +278,10 @@ theme_adium_parse_body (const gchar *text) { GString *string; + empathy_conf_get_bool (empathy_conf_get (), + EMPATHY_PREFS_CHAT_SHOW_SMILEYS, + &use_smileys); + /* We parse text in 4 steps: url, smiley, newline, escape. * For each step, we detect the position of tokens in the text, and * we give text between each token to the next level parser. |