Permalink
Browse files

Adding mailboxes was broken with evolution 3.4. Fixed

  • Loading branch information...
1 parent a9d25d6 commit dacd03444028050a8632d19fe49f1f4e61b2af51 @epienbroek committed Aug 21, 2012
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/mn-evolution-folder-tree-server.gob
@@ -86,7 +86,15 @@ class MN:Evolution:Folder:Tree:Server from G:Object
constructor (self)
{
#if EDS_CHECK_VERSION(3,1,0)
- selfp->tree = em_folder_tree_new(NULL, NULL);
+ EShell *shell = e_shell_get_default();
+ EShellBackend *shell_backend = e_shell_get_backend_by_name(shell, "mail");
+ GtkWidget *browser = e_mail_browser_new (E_MAIL_BACKEND(shell_backend));
+ EAlertSink *alert_sink = e_mail_reader_get_alert_sink(E_MAIL_READER(browser));
+#if EDS_CHECK_VERSION(3,4,0)
+ selfp->tree = em_folder_tree_new(e_mail_session_new(), alert_sink);
+#else
+ selfp->tree = em_folder_tree_new(E_MAIL_BACKEND(shell_backend), alert_sink);
+#endif
#elif EDS_CHECK_VERSION(2,91,0)
selfp->session = e_mail_session_new();
selfp->tree = em_folder_tree_new(selfp->session);
@@ -119,8 +127,11 @@ class MN:Evolution:Folder:Tree:Server from G:Object
finalize (self)
{
#if EDS_CHECK_VERSION(2,91,0)
- g_object_unref(selfp->session);
- selfp->session = NULL;
+ if (selfp->session)
+ {
+ g_object_unref(selfp->session);
+ selfp->session = NULL;
+ }
#endif
g_signal_handlers_disconnect_by_func(selfp->plug, self_plug_destroy_h, self);
}

0 comments on commit dacd034

Please sign in to comment.