aboutsummaryrefslogtreecommitdiffstats
path: root/modules/text-highlight
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-03-10 21:53:12 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-03-17 20:49:12 +0800
commit2e87aa81fc94f5d9564421e036adae7b48e7380a (patch)
tree9576f15a49a6101c9246c6ce0f82e5c7bd4575c2 /modules/text-highlight
parent95a0ae4afb72b534c991fbcd774733a93f256514 (diff)
downloadgsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar
gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.gz
gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.bz2
gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.lz
gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.xz
gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.tar.zst
gsoc2013-evolution-2e87aa81fc94f5d9564421e036adae7b48e7380a.zip
Remove EMailShellSettings.
EShellSettings predates GSettings and is no longer necessary. GSettings allows binding GObject properties to GSettings keys, with optional mapping functions. That fulfills the purpose of EShellSettings.
Diffstat (limited to 'modules/text-highlight')
-rw-r--r--modules/text-highlight/e-mail-formatter-text-highlight.c61
1 files changed, 19 insertions, 42 deletions
diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.c b/modules/text-highlight/e-mail-formatter-text-highlight.c
index aec403c29c..f1a97b34a9 100644
--- a/modules/text-highlight/e-mail-formatter-text-highlight.c
+++ b/modules/text-highlight/e-mail-formatter-text-highlight.c
@@ -28,9 +28,6 @@
#include <em-format/e-mail-part-utils.h>
#include <e-util/e-util.h>
-#include <shell/e-shell-settings.h>
-#include <shell/e-shell.h>
-
#include <libebackend/libebackend.h>
#include <libedataserver/libedataserver.h>
@@ -52,21 +49,6 @@ G_DEFINE_DYNAMIC_TYPE (
E_TYPE_MAIL_FORMATTER_EXTENSION)
static gchar *
-get_default_font (void)
-{
- gchar *font;
- GSettings *settings;
-
- settings = g_settings_new ("org.gnome.desktop.interface");
-
- font = g_settings_get_string (settings, "monospace-font-name");
-
- g_object_unref (settings);
-
- return font ? font : g_strdup ("monospace 10");
-}
-
-static gchar *
get_syntax (EMailPart *part,
const gchar *uri)
{
@@ -177,10 +159,9 @@ emfe_text_highlight_format (EMailFormatterExtension *extension,
GPid pid;
CamelDataWrapper *dw;
gchar *font_family, *font_size, *syntax;
- gboolean use_custom_font;
- EShell *shell;
- EShellSettings *settings;
PangoFontDescription *fd;
+ GSettings *settings;
+ gchar *font = NULL;
gboolean success;
const gchar *argv[] = { HIGHLIGHT_COMMAND,
@@ -207,30 +188,26 @@ emfe_text_highlight_format (EMailFormatterExtension *extension,
return FALSE;
}
- shell = e_shell_get_default ();
- settings = e_shell_get_shell_settings (shell);
-
- fd = NULL;
- use_custom_font = e_shell_settings_get_boolean (
- settings, "mail-use-custom-fonts");
- if (!use_custom_font) {
- gchar *font;
-
- font = get_default_font ();
- fd = pango_font_description_from_string (font);
- g_free (font);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ if (g_settings_get_boolean (settings, "use-custom-font"))
+ font = g_settings_get_string (
+ settings, "monospace-font");
+ g_object_unref (settings);
+
+ if (font == NULL) {
+ settings = g_settings_new (
+ "org.gnome.desktop.interface");
+ font = g_settings_get_string (
+ settings, "monospace-font-name");
+ g_object_unref (settings);
+ }
- } else {
- gchar *font;
+ if (font == NULL)
+ font = g_strdup ("monospace 10");
- font = e_shell_settings_get_string (
- settings, "mail-font-monospace");
- if (!font)
- font = get_default_font ();
+ fd = pango_font_description_from_string (font);
- fd = pango_font_description_from_string (font);
- g_free (font);
- }
+ g_free (font);
font_family = g_strdup_printf (
"--font='%s'",