]> git.0d.be Git - empathy.git/commitdiff
Optimisation: Do not fetch use-smiley gconf key for each substring.
authorXavier Claessens <xclaesse@gmail.com>
Sun, 1 Nov 2009 10:24:35 +0000 (11:24 +0100)
committerXavier Claessens <xclaesse@gmail.com>
Tue, 24 Nov 2009 17:29:44 +0000 (18:29 +0100)
libempathy-gtk/empathy-theme-adium.c

index f1da329e3748122761d749aeff598b2a0b6937b2..5aae85c4a97d828cfffe171c360609d12811769c 100644 (file)
@@ -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.