[evolution-rss] Adapt to changes in evolution 3.21.90



commit 7741ef0cf3327cb5c719912358443b6aef3bdb59
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 17 18:43:48 2016 +0200

    Adapt to changes in evolution 3.21.90

 src/e-mail-formatter-evolution-rss.c |   11 +++++++++++
 src/rss.c                            |   18 ++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/e-mail-formatter-evolution-rss.c b/src/e-mail-formatter-evolution-rss.c
index f71557d..afdf6cd 100644
--- a/src/e-mail-formatter-evolution-rss.c
+++ b/src/e-mail-formatter-evolution-rss.c
@@ -52,6 +52,7 @@ G_DEFINE_DYNAMIC_TYPE (
 
 static const gchar* rss_formatter_mime_types[] = { "x-evolution/evolution-rss-feed", NULL };
 
+#if EVOLUTION_VERSION < 32190
 static void
 set_view_cb (GtkWidget *button,
                gpointer *data)
@@ -60,6 +61,8 @@ set_view_cb (GtkWidget *button,
        rss_set_changed_view(1);
        e_mail_display_reload (rss_get_display());
 }
+#endif
+
 #include "fetch.h"
 
 typedef struct _HD HD;
@@ -132,7 +135,11 @@ emfe_evolution_rss_format (EMailFormatterExtension *extension,
        if (!rss_init)
                        goto fail;
 
+#if EVOLUTION_VERSION >= 32190
+       h = e_web_view_get_content_html_sync (E_WEB_VIEW (rss_get_display()), NULL, NULL);
+#else
        h = g_strdup(e_web_view_get_html (E_WEB_VIEW (rss_get_display())));
+#endif
 
        website = (gchar *)camel_medium_get_header (
                        CAMEL_MEDIUM (message), "Website");
@@ -380,6 +387,7 @@ e_mail_formatter_evolution_rss_type_register (GTypeModule *type_module)
        e_mail_formatter_evolution_rss_register_type (type_module);
 }
 
+#if EVOLUTION_VERSION < 32190
 static GtkWidget *
 emfe_evolution_rss_get_widget (EMailFormatterExtension *extension,
                                EMailPartList *context,
@@ -404,13 +412,16 @@ emfe_evolution_rss_get_widget (EMailFormatterExtension *extension,
        gtk_widget_show(box);
        return box;
 }
+#endif
 
 static void
 e_mail_formatter_evolution_rss_class_init (EMailFormatterExtensionClass *class)
 {
        class->mime_types = rss_formatter_mime_types;
        class->format = emfe_evolution_rss_format;
+#if EVOLUTION_VERSION < 32190
        class->get_widget = emfe_evolution_rss_get_widget;
+#endif
        class->display_name = _("Evolution-RSS");
        class->description = _("Displaying RSS feed articles");
 }
diff --git a/src/rss.c b/src/rss.c
index 20b6d33..e21f0f1 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -1326,15 +1326,24 @@ org_gnome_evolution_presend (EPlugin *ep, EMEventTargetComposer *t)
 
 #if EVOLUTION_VERSION >= 31303
        EHTMLEditor *editor;
+#if EVOLUTION_VERSION >= 32190
+       EContentEditor *cnt_editor;
+#else
        EHTMLEditorView *view;
+#endif
 
        editor = e_msg_composer_get_editor (t->composer);
+#if EVOLUTION_VERSION >= 32190
+       cnt_editor = e_html_editor_get_content_editor (editor);
+       text = e_content_editor_get_content (cnt_editor, E_CONTENT_EDITOR_GET_TEXT_HTML, NULL, NULL);
+#else
        view = e_html_editor_get_view (editor);
 #if EVOLUTION_VERSION >= 31390
        text = e_html_editor_view_get_text_html (view, NULL, NULL);
 #else
        text = e_html_editor_view_get_text_html (view);
 #endif
+#endif /* EVOLUTION_VERSION >= 32190 */
        length = strlen (text);
 #else
        /* unfortunately e_msg_composer does not have raw get/set text body
@@ -1352,8 +1361,17 @@ org_gnome_evolution_presend (EPlugin *ep, EMEventTargetComposer *t)
                g_free (text);
                text = g_strndup ((gchar *) buff, size);
                editor = e_msg_composer_get_editor (t->composer);
+#if EVOLUTION_VERSION >= 32190
+               cnt_editor = e_html_editor_get_content_editor (editor);
+               e_content_editor_insert_content (
+                       cnt_editor,
+                       text,
+                       E_CONTENT_EDITOR_INSERT_TEXT_HTML |
+                       E_CONTENT_EDITOR_INSERT_REPLACE_ALL);
+#else
                view = e_html_editor_get_view (editor);
                e_html_editor_view_set_text_html (view, text);
+#endif
 #else
                gtkhtml_editor_set_text_html((GtkhtmlEditor *)t->composer, (gchar *)buff, size);
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]