freebsd-ports/mail/mail-notification/files/patch-50-evolution
Pav Lucistnik d366466849 - Unbreak Evolution support
- Bring patches from Fedora

PR:		ports/156982
Submitted by:	Marcin Wisnicki <mwisnicki+freebsd@gmail.com> (maintainer)
2011-06-23 12:07:38 +00:00

188 lines
5.2 KiB
Text

diff -Nrbu build/src/mn-evolution-folder-tree-server.c build/src/mn-evolution-folder-tree-server.c
--- build/src/mn-evolution-folder-tree-server.c 2008-05-22 19:47:48.000000000 +0400
+++ build/src/mn-evolution-folder-tree-server.c 2010-09-17 17:45:05.000000000 +0400
@@ -25,7 +25,10 @@
#line 24 "src/mn-evolution-folder-tree-server.gob"
#include <dbus/dbus.h>
+#include <libedataserver/eds-version.h>
+#if !EDS_CHECK_VERSION(2,29,0)
#include <mail/mail-component.h>
+#endif
#include <mail/em-folder-tree.h>
#include "mn-evolution-plugin.h"
#include "mn-evolution.h"
@@ -441,10 +444,14 @@
{
#line 61 "src/mn-evolution-folder-tree-server.gob"
+#if EDS_CHECK_VERSION(2,29,0)
+ selfp->tree = em_folder_tree_new();
+#else
EMFolderTreeModel *model;
model = mail_component_peek_tree_model(mail_component_peek());
selfp->tree = em_folder_tree_new_with_model(model);
+#endif
selfp->plug = gtk_plug_new((GdkNativeWindow) selfp->id);
gtk_container_add(GTK_CONTAINER(selfp->plug), selfp->tree);
diff -Nrbu build/src/mn-evolution-server.c build/src/mn-evolution-server.c
--- build/src/mn-evolution-server.c 2008-05-22 19:47:48.000000000 +0400
+++ build/src/mn-evolution-server.c 2010-09-17 17:45:32.000000000 +0400
@@ -27,10 +27,16 @@
#include <stdio.h>
#include <libintl.h>
#include <gobject/gvaluecollector.h>
+#include <libedataserver/eds-version.h>
#include <camel/camel-folder.h>
+#if EDS_CHECK_VERSION(2,29,0)
+#include <shell/e-shell.h>
+#include <mail/e-mail-browser.h>
+#else
#include <mail/em-folder-view.h>
#include <mail/em-format.h>
#include <mail/em-message-browser.h>
+#endif
#include <mail/em-utils.h>
#include <mail/mail-session.h>
#include <mail/mail-tools.h>
@@ -391,10 +397,18 @@
info = g_new0(FolderInfo, 1);
info->uri = g_strdup(uri);
info->folder = folder;
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_ref(folder);
+#else
camel_object_ref(folder);
+#endif
/* uncache the folder when it is deleted */
+#if EDS_CHECK_VERSION(2,31,0)
+ g_signal_connect(folder, "deleted", G_CALLBACK(self_folder_deleted_cb), info);
+#else
camel_object_hook_event(folder, "deleted", self_folder_deleted_cb, info);
+#endif
g_hash_table_replace(folders, info->uri, info);
}}
@@ -413,8 +427,13 @@
{
#line 105 "src/mn-evolution-server.gob"
+#if EDS_CHECK_VERSION(2,31,0)
+ g_signal_handlers_disconnect_by_func(info->folder, self_folder_deleted_cb, info);
+ g_object_unref(info->folder);
+#else
camel_object_unhook_event(info->folder, "deleted", self_folder_deleted_cb, info);
camel_object_unref(info->folder);
+#endif
g_free(info->uri);
g_free(info);
}}
@@ -461,7 +480,11 @@
if (info)
{
folder = info->folder;
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_ref(folder);
+#else
camel_object_ref(folder);
+#endif
}
}
else
@@ -595,14 +618,23 @@
for (i = 0; i < summary->len; i++)
{
+#if EDS_CHECK_VERSION(2,23,5)
+ char *uid = summary->pdata[i];
+ CamelMessageInfo *info = camel_folder_get_message_info(folder, uid);
+#else
CamelMessageInfo *info = summary->pdata[i];
+#endif
if ((camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) == 0)
g_ptr_array_add(*ret, self_camel_message_info_to_dbus_struct(info));
}
camel_folder_free_summary(folder, summary);
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
}
GDK_THREADS_LEAVE();
@@ -638,7 +670,11 @@
if (folder)
{
*ret = g_strdup(camel_folder_get_name(folder));
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
}
GDK_THREADS_LEAVE();
@@ -673,6 +709,19 @@
folder = self_lookup_folder(folder_uri, err);
if (folder)
{
+#if EDS_CHECK_VERSION(2,29,0)
+ EShell *shell;
+ EShellBackend *shell_backend;
+ GtkWidget *browser;
+
+ shell = e_shell_get_default ();
+ shell_backend = e_shell_get_backend_by_name (shell, "mail");
+
+ browser = e_mail_browser_new (shell_backend);
+ e_mail_reader_set_folder (E_MAIL_READER (browser), folder, folder_uri);
+ e_mail_reader_set_message (E_MAIL_READER (browser), message_uid);
+ gtk_widget_show (browser);
+#else
GtkWidget *browser;
/* modelled after Evolution's handleuri_got_folder() */
@@ -683,8 +732,13 @@
em_folder_view_set_folder((EMFolderView *) browser, folder, folder_uri);
em_folder_view_set_message((EMFolderView *) browser, message_uid, FALSE);
gtk_widget_show(((EMMessageBrowser *) browser)->window);
+#endif
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
}
GDK_THREADS_LEAVE();
@@ -721,7 +775,11 @@
if (folder)
{
status = camel_folder_set_message_flags(folder, message_uid, flags, flags);
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
if (! status)
g_set_error(err,
diff -Nrbu src/mn-evolution-plugin.c src/mn-evolution-plugin.c
--- src/mn-evolution-plugin.c 2008-05-22 19:45:35.000000000 +0400
+++ src/mn-evolution-plugin.c 2010-09-17 17:45:05.000000000 +0400
@@ -204,7 +204,7 @@
}
int
-e_plugin_lib_enable (EPluginLib *ep, int enable)
+e_plugin_lib_enable (EPlugin *ep, int enable)
{
static gboolean enabled = FALSE;
GError *err = NULL;