aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-backend.c3
-rw-r--r--mail/e-mail-reader.c44
-rw-r--r--mail/e-mail-session.c11
-rw-r--r--mail/e-mail-store.c2
-rw-r--r--mail/em-folder-tree-model.c142
-rw-r--r--mail/em-folder-tree-model.h4
-rw-r--r--mail/em-subscription-editor.h2
-rw-r--r--mail/mail-config.ui1
-rw-r--r--mail/message-list.c2
9 files changed, 202 insertions, 9 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 5768934b1a..56f2dc67b3 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -272,6 +272,7 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
EMailBackend *backend)
{
EAccountList *account_list;
+ EMailSession *session;
gboolean delete_junk;
gboolean empty_trash;
@@ -280,6 +281,8 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
gboolean empty_trash;
} sync_data;
+ session = e_mail_backend_get_session (backend);
+
delete_junk = e_mail_backend_delete_junk_policy_decision (backend);
empty_trash = e_mail_backend_empty_trash_policy_decision (backend);
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 920994242a..76502314ab 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -632,7 +632,10 @@ action_mail_forward_quoted_cb (GtkAction *action,
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
+<<<<<<< HEAD
+=======
gboolean close_reader;
+>>>>>>> master
folder = e_mail_reader_get_folder (reader);
window = e_mail_reader_get_window (reader);
@@ -647,8 +650,14 @@ action_mail_forward_quoted_cb (GtkAction *action,
if (em_utils_ask_open_many (window, uids->len))
em_utils_forward_messages (
reader, folder, uids,
+<<<<<<< HEAD
+ E_MAIL_FORWARD_STYLE_QUOTED);
+
+ g_ptr_array_unref (uids);
+=======
E_MAIL_FORWARD_STYLE_QUOTED,
close_reader ? GTK_WIDGET (reader) : NULL);
+>>>>>>> master
g_ptr_array_unref (uids);
}
@@ -741,7 +750,11 @@ action_mail_mark_unread_cb (GtkAction *action,
/* Notify the tree model that the user has marked messages as
* unread so it doesn't mistake the event as new mail arriving. */
+<<<<<<< HEAD
+ model = em_folder_tree_model_get_default (e_mail_reader_get_backend (reader));
+=======
model = em_folder_tree_model_get_default ();
+>>>>>>> master
folder = e_mail_reader_get_folder (reader);
em_folder_tree_model_user_marked_unread (model, folder, n_marked);
}
@@ -761,10 +774,17 @@ action_mail_message_edit_cb (GtkAction *action,
/* XXX Either e_mail_reader_get_selected_uids()
* or MessageList should do this itself. */
g_ptr_array_set_free_func (uids, (GDestroyNotify) g_free);
+<<<<<<< HEAD
+
+ replace = em_utils_folder_is_drafts (folder);
+ em_utils_edit_messages (reader, folder, uids, replace);
+
+=======
replace = em_utils_folder_is_drafts (folder);
em_utils_edit_messages (reader, folder, uids, replace);
+>>>>>>> master
g_ptr_array_unref (uids);
}
@@ -815,7 +835,11 @@ action_mail_move_cb (GtkAction *action,
uids = e_mail_reader_get_selected_uids (reader);
window = e_mail_reader_get_window (reader);
+<<<<<<< HEAD
+ model = em_folder_tree_model_get_default (backend);
+=======
model = em_folder_tree_model_get_default ();
+>>>>>>> master
dialog = em_folder_selector_new (
window, backend, model,
@@ -1135,11 +1159,19 @@ action_mail_reply_all_check (CamelFolder *folder,
gint recip_count = 0;
EMailReplyType type = E_MAIL_REPLY_TO_ALL;
GError *error = NULL;
+<<<<<<< HEAD
+
+ alert_sink = e_activity_get_alert_sink (closure->activity);
+
+ message = camel_folder_get_message_finish (folder, result, &error);
+
+=======
alert_sink = e_activity_get_alert_sink (closure->activity);
message = camel_folder_get_message_finish (folder, result, &error);
+>>>>>>> master
if (e_activity_handle_cancellation (closure->activity, error)) {
g_warn_if_fail (message == NULL);
mail_reader_closure_free (closure);
@@ -1320,6 +1352,17 @@ action_mail_reply_sender_check (CamelFolder *folder,
GError *error = NULL;
alert_sink = e_activity_get_alert_sink (closure->activity);
+<<<<<<< HEAD
+
+ message = camel_folder_get_message_finish (folder, result, &error);
+
+ if (e_activity_handle_cancellation (closure->activity, error)) {
+ g_warn_if_fail (message == NULL);
+ mail_reader_closure_free (closure);
+ g_error_free (error);
+ return;
+
+=======
message = camel_folder_get_message_finish (folder, result, &error);
@@ -1329,6 +1372,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
g_error_free (error);
return;
+>>>>>>> master
} else if (error != NULL) {
g_warn_if_fail (message == NULL);
e_alert_submit (
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c
index 45c8e0209c..109e49826d 100644
--- a/mail/e-mail-session.c
+++ b/mail/e-mail-session.c
@@ -52,6 +52,7 @@
#include "e-util/e-util.h"
#include "e-util/e-account-utils.h"
#include "e-util/e-alert-dialog.h"
+#include "e-util/e-extensible.h"
#include "e-util/e-util-private.h"
#include "e-util/gconf-bridge.h"
@@ -632,6 +633,16 @@ mail_session_finalize (GObject *object)
g_free (mail_data_dir);
g_free (mail_config_dir);
+ if (proxy_settings) {
+ g_signal_handlers_disconnect_by_func (proxy_settings, proxy_gsettings_changed_cb, CAMEL_SESSION (object));
+ g_object_unref (proxy_settings);
+ }
+
+ if (proxy_socks_settings) {
+ g_signal_handlers_disconnect_by_func (proxy_socks_settings, proxy_gsettings_changed_cb, CAMEL_SESSION (object));
+ g_object_unref (proxy_socks_settings);
+ }
+
/* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_mail_session_parent_class)->finalize (object);
}
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index e59e7b2abd..f93856a8f4 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -428,7 +428,7 @@ e_mail_store_remove (EMailBackend *backend,
folder_cache = e_mail_session_get_folder_cache (session);
mail_folder_cache_note_store_remove (folder_cache, store);
- default_model = em_folder_tree_model_get_default ();
+ default_model = em_folder_tree_model_get_default (NULL);
em_folder_tree_model_remove_store (default_model, store);
mail_disconnect_store (store);
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 1e7840710f..cc674cd792 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -426,6 +426,11 @@ folder_tree_model_set_property (GObject *object,
EM_FOLDER_TREE_MODEL (object),
g_value_get_object (value));
return;
+ case PROP_BACKEND:
+ em_folder_tree_model_set_backend (
+ EM_FOLDER_TREE_MODEL (object),
+ g_value_get_object (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -451,11 +456,74 @@ folder_tree_model_get_property (GObject *object,
em_folder_tree_model_get_backend (
EM_FOLDER_TREE_MODEL (object)));
return;
+ case PROP_BACKEND:
+ g_value_set_object (
+ value,
+ em_folder_tree_model_get_backend (
+ EM_FOLDER_TREE_MODEL (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
+
+static void
+folder_tree_model_constructed (GObject *object)
+{
+ EShell *shell;
+ EShellSettings *shell_settings;
+ EMFolderTreeModel *model;
+
+ GType col_types[] = {
+ G_TYPE_STRING, /* display name */
+ G_TYPE_POINTER, /* store object */
+ G_TYPE_STRING, /* full name */
+ G_TYPE_STRING, /* icon name */
+ G_TYPE_STRING, /* uri */
+ G_TYPE_UINT, /* unread count */
+ G_TYPE_UINT, /* flags */
+ G_TYPE_BOOLEAN, /* is a store node */
+ G_TYPE_BOOLEAN, /* is a folder node */
+ G_TYPE_BOOLEAN, /* has not-yet-loaded subfolders */
+ G_TYPE_UINT, /* last known unread count */
+ G_TYPE_BOOLEAN, /* folder is a draft folder */
+ G_TYPE_UINT /* user's sortorder */
+ };
+
+ model = EM_FOLDER_TREE_MODEL (object);
+ shell = e_shell_backend_get_shell (E_SHELL_BACKEND (model->priv->backend));
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ gtk_tree_store_set_column_types (
+ GTK_TREE_STORE (model), NUM_COLUMNS, col_types);
+ gtk_tree_sortable_set_default_sort_func (
+ GTK_TREE_SORTABLE (model),
+ folder_tree_model_sort, shell, NULL);
+ gtk_tree_sortable_set_sort_column_id (
+ GTK_TREE_SORTABLE (model),
+ GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
+ GTK_SORT_ASCENDING);
+
+ model->priv->accounts = e_get_account_list ();
+ model->priv->account_changed_id = g_signal_connect (
+ model->priv->accounts, "account-changed",
+ G_CALLBACK (account_changed_cb), model);
+ model->priv->account_removed_id = g_signal_connect (
+ model->priv->accounts, "account-removed",
+ G_CALLBACK (account_removed_cb), model);
+ model->priv->account_added_id = g_signal_connect (
+ model->priv->accounts, "account-added",
+ G_CALLBACK (account_added_cb), model);
+
+ g_signal_connect_swapped (model->priv->backend, "account-sort-order-changed", G_CALLBACK (account_sort_order_changed_cb), model);
+ g_signal_connect_swapped (shell_settings, "notify::mail-sort-accounts-alpha", G_CALLBACK (account_sort_order_changed_cb), model);
+ g_signal_connect_swapped (shell_settings, "notify::mail-enable-local-folders", G_CALLBACK (enable_local_folders_changed_cb), model);
+ g_signal_connect_swapped (shell_settings, "notify::mail-enable-search-folders", G_CALLBACK (enable_search_folders_changed_cb), model);
+
+ G_OBJECT_CLASS (parent_class)->constructed (object);
+}
+
static void
folder_tree_model_dispose (GObject *object)
{
@@ -492,6 +560,24 @@ folder_tree_model_dispose (GObject *object)
priv->backend = NULL;
}
+ if (priv->backend) {
+ EShell *shell;
+ EShellSettings *shell_settings;
+ EMFolderTreeModel *model;
+
+ model = EM_FOLDER_TREE_MODEL (object);
+ shell = e_shell_backend_get_shell (E_SHELL_BACKEND (priv->backend));
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ g_signal_handlers_disconnect_by_func (priv->backend, G_CALLBACK (account_sort_order_changed_cb), model);
+ g_signal_handlers_disconnect_by_func (shell_settings, G_CALLBACK (account_sort_order_changed_cb), model);
+ g_signal_handlers_disconnect_by_func (shell_settings, G_CALLBACK (enable_local_folders_changed_cb), model);
+ g_signal_handlers_disconnect_by_func (shell_settings, G_CALLBACK (enable_search_folders_changed_cb), model);
+
+ g_object_unref (priv->backend);
+ priv->backend = NULL;
+ }
+
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@@ -576,6 +662,7 @@ em_folder_tree_model_class_init (EMFolderTreeModelClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->set_property = folder_tree_model_set_property;
object_class->get_property = folder_tree_model_get_property;
+ object_class->constructed = folder_tree_model_constructed;
object_class->dispose = folder_tree_model_dispose;
object_class->finalize = folder_tree_model_finalize;
object_class->constructed = folder_tree_model_constructed;
@@ -600,6 +687,16 @@ em_folder_tree_model_class_init (EMFolderTreeModelClass *class)
GTK_TYPE_TREE_SELECTION,
G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_BACKEND,
+ g_param_spec_object (
+ "backend",
+ NULL,
+ NULL,
+ E_TYPE_MAIL_BACKEND,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
signals[LOADING_ROW] = g_signal_new (
"loading-row",
G_OBJECT_CLASS_TYPE (object_class),
@@ -700,18 +797,26 @@ em_folder_tree_model_init (EMFolderTreeModel *model)
}
EMFolderTreeModel *
-em_folder_tree_model_new (void)
+em_folder_tree_model_new (EMailBackend *mail_backend)
{
- return g_object_new (EM_TYPE_FOLDER_TREE_MODEL, NULL);
+ return g_object_new (EM_TYPE_FOLDER_TREE_MODEL, "backend", mail_backend, NULL);
}
EMFolderTreeModel *
-em_folder_tree_model_get_default (void)
+em_folder_tree_model_get_default (EMailBackend *mail_backend)
{
static EMFolderTreeModel *default_folder_tree_model;
- if (G_UNLIKELY (default_folder_tree_model == NULL))
- default_folder_tree_model = em_folder_tree_model_new ();
+ if (G_UNLIKELY (default_folder_tree_model == NULL)) {
+ if (!mail_backend) {
+ EShell *shell;
+
+ shell = e_shell_get_default ();
+ mail_backend = E_MAIL_BACKEND (e_shell_get_backend_by_name (shell, "mail"));
+ }
+
+ default_folder_tree_model = em_folder_tree_model_new (mail_backend);
+ }
return default_folder_tree_model;
}
@@ -814,6 +919,33 @@ em_folder_tree_model_set_backend (EMFolderTreeModel *model,
g_object_notify (G_OBJECT (model), "backend");
}
+EMailBackend *
+em_folder_tree_model_get_backend (EMFolderTreeModel *model)
+{
+ g_return_val_if_fail (EM_IS_FOLDER_TREE_MODEL (model), NULL);
+
+ return model->priv->backend;
+}
+
+void
+em_folder_tree_model_set_backend (EMFolderTreeModel *model,
+ EMailBackend *backend)
+{
+ g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model));
+
+ if (backend != NULL) {
+ g_return_if_fail (E_IS_MAIL_BACKEND (backend));
+ g_object_ref (backend);
+ }
+
+ if (model->priv->backend != NULL)
+ g_object_unref (model->priv->backend);
+
+ model->priv->backend = backend;
+
+ g_object_notify (G_OBJECT (model), "backend");
+}
+
void
em_folder_tree_model_set_folder_info (EMFolderTreeModel *model,
GtkTreeIter *iter,
diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h
index 0ed007aa96..0188753942 100644
--- a/mail/em-folder-tree-model.h
+++ b/mail/em-folder-tree-model.h
@@ -111,9 +111,9 @@ struct _EMFolderTreeModelClass {
GType em_folder_tree_model_get_type (void);
EMFolderTreeModel *
- em_folder_tree_model_new (void);
+ em_folder_tree_model_new (EMailBackend *mail_backend);
EMFolderTreeModel *
- em_folder_tree_model_get_default (void);
+ em_folder_tree_model_get_default (EMailBackend *mail_backend);
GtkTreeSelection *
em_folder_tree_model_get_selection
(EMFolderTreeModel *model);
diff --git a/mail/em-subscription-editor.h b/mail/em-subscription-editor.h
index 80b371f744..1b297f44ed 100644
--- a/mail/em-subscription-editor.h
+++ b/mail/em-subscription-editor.h
@@ -65,6 +65,8 @@ EMailBackend * em_subscription_editor_get_backend
(EMSubscriptionEditor *editor);
CamelStore * em_subscription_editor_get_store
(EMSubscriptionEditor *editor);
+CamelStore * em_subscription_editor_get_store
+ (EMSubscriptionEditor *editor);
G_END_DECLS
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index 7567d18603..8c788b69ad 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -4332,6 +4332,7 @@ For example: "Work" or "Personal"</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
diff --git a/mail/message-list.c b/mail/message-list.c
index 1e903a3f48..603fc71d89 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4191,7 +4191,7 @@ on_click (ETree *tree,
if (col == COL_MESSAGE_STATUS && (flags & CAMEL_MESSAGE_SEEN)) {
EMFolderTreeModel *model;
- model = em_folder_tree_model_get_default ();
+ model = em_folder_tree_model_get_default (list->priv->backend);
em_folder_tree_model_user_marked_unread (
model, list->folder, 1);
}