Skip to content
Browse files

Make the evolution plugin compatible with evolution 3.2 and 3.4

  • Loading branch information...
1 parent b7c74d3 commit 33ea09401cac64dd60e1da107c39e2fccedc2203 @epienbroek committed Aug 21, 2012
Showing with 41 additions and 1 deletion.
  1. +32 −0 src/mn-evolution-folder-tree-server.gob
  2. +9 −1 src/mn-evolution-server.gob
View
32 src/mn-evolution-folder-tree-server.gob
@@ -35,6 +35,12 @@ typedef EMailSession void;
#if !EDS_CHECK_VERSION(2,29,0)
#include <mail/mail-component.h>
#endif
+#if EDS_CHECK_VERSION(3,1,0)
+#include <mail/e-mail-folder-utils.h>
+#include <mail/e-mail-browser.h>
+#include <mail/e-mail-reader.h>
+#include <shell/e-shell.h>
+#endif
#include <mail/em-folder-tree.h>
#include "mn-evolution-plugin.h"
#include "mn-evolution.h"
@@ -92,8 +98,13 @@ class MN:Evolution:Folder:Tree:Server from G:Object
g_signal_connect(selfp->plug, "destroy", G_CALLBACK(self_plug_destroy_h), self);
g_object_connect(selfp->tree,
+#if EDS_CHECK_VERSION(3,1,0)
+ "signal::folder-selected", self_selected_evo31_h, self,
+ "signal::folder-activated", self_activated_evo31_h, self,
+#else
"signal::folder-selected", self_selected_h, self,
"signal::folder-activated", self_activated_h, self,
+#endif
NULL);
}
@@ -127,6 +138,17 @@ class MN:Evolution:Folder:Tree:Server from G:Object
}
private void
+ selected_evo31_h (EMFolderTree *tree,
+ CamelStore *store,
+ const char *folder_name,
+ guint32 flags,
+ gpointer user_data)
+ {
+ Self *self = user_data;
+ self_folder_selected(self, uri);
+ }
+
+ private void
selected_h (EMFolderTree *tree,
const char *full_name,
const char *uri,
@@ -138,6 +160,16 @@ class MN:Evolution:Folder:Tree:Server from G:Object
}
private void
+ activated_evo31_h (EMFolderTree *tree,
+ CamelStore * store,
+ const char * folder_name,
+ gpointer user_data)
+ {
+ Self *self = user_data;
+ self_folder_activated(self);
+ }
+
+ private void
activated_h (EMFolderTree *tree,
const char *full_name,
const char *uri,
View
10 src/mn-evolution-server.gob
@@ -172,7 +172,15 @@ class MN:Evolution:Server from G:Object
#if EDS_CHECK_VERSION(2,91,0)
static EMailSession * session = NULL;
if (! session)
- session = e_mail_session_new();
+ {
+#if EDS_CHECK_VERSION(3,1,0)
+ EShell *shell = e_shell_get_default();
+ EShellBackend *shell_backend = e_shell_get_backend_by_name(shell, "mail");
+ session = E_MAIL_SESSION(e_mail_backend_get_session(E_MAIL_BACKEND(shell_backend)));
+#else
+ session = e_mail_session_new();
+#endif
+ }
folder = e_mail_session_uri_to_folder_sync(session, uri, 0, NULL, NULL);
#endif

0 comments on commit 33ea094

Please sign in to comment.
Something went wrong with that request. Please try again.