[empathy] theme_adium_parse_body: use the cache GSettings chat
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] theme_adium_parse_body: use the cache GSettings chat
- Date: Mon, 29 Nov 2010 15:59:51 +0000 (UTC)
commit 086f0fc0375d06fa0c41cf921f883ed36fdb14d0
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Nov 29 16:23:19 2010 +0100
theme_adium_parse_body: use the cache GSettings chat
libempathy-gtk/empathy-theme-adium.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 921956e..bdc5ea5 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -249,14 +249,16 @@ static EmpathyStringParser string_parsers_with_smiley[] = {
};
static gchar *
-theme_adium_parse_body (const gchar *text)
+theme_adium_parse_body (EmpathyThemeAdium *self,
+ const gchar *text)
{
+ EmpathyThemeAdiumPriv *priv = GET_PRIV (self);
EmpathyStringParser *parsers;
GString *string;
- GSettings *gsettings = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
/* Check if we have to parse smileys */
- if (g_settings_get_boolean (gsettings, EMPATHY_PREFS_CHAT_SHOW_SMILEYS))
+ if (g_settings_get_boolean (priv->gsettings_chat,
+ EMPATHY_PREFS_CHAT_SHOW_SMILEYS))
parsers = string_parsers_with_smiley;
else
parsers = string_parsers;
@@ -267,8 +269,6 @@ theme_adium_parse_body (const gchar *text)
string = g_string_sized_new (strlen (text));
empathy_string_parser_substr (text, -1, parsers, string);
- g_object_unref (gsettings);
-
/* Wrap body in order to make tabs and multiple spaces displayed
* properly. See bug #625745. */
g_string_prepend (string, "<div style=\"display: inline; "
@@ -469,7 +469,7 @@ theme_adium_append_message (EmpathyChatView *view,
service_name = tp_account_get_protocol (account);
timestamp = empathy_message_get_timestamp (msg);
body = empathy_message_get_body (msg);
- body_escaped = theme_adium_parse_body (body);
+ body_escaped = theme_adium_parse_body (theme, body);
name = empathy_contact_get_alias (sender);
contact_id = empathy_contact_get_id (sender);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]