aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-15 10:55:03 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-15 11:21:41 +0800
commit5b1742b202ca9505ccd818918b4afe82fc61b63b (patch)
tree6653da03ad3e8139e938e79ed3571c5fea4c818a /plugins
parentcf669f10f22de13ab4ee9b323d274325af22b0b9 (diff)
downloadgsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.tar
gsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.tar.gz
gsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.tar.bz2
gsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.tar.lz
gsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.tar.xz
gsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.tar.zst
gsoc2013-evolution-5b1742b202ca9505ccd818918b4afe82fc61b63b.zip
Add e_mail_reader_ref_folder().
Replaces e_mail_reader_get_folder().
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mail-to-task/mail-to-task.c4
-rw-r--r--plugins/mailing-list-actions/mailing-list-actions.c7
-rw-r--r--plugins/templates/templates.c15
3 files changed, 14 insertions, 12 deletions
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 0293701a0e..12ff5b0c95 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -1105,7 +1105,6 @@ mail_to_event (ECalClientSourceType source_type,
EShell *shell;
EMailBackend *backend;
ESourceRegistry *registry;
- CamelFolder *folder;
GPtrArray *uids;
ESource *source = NULL;
ESource *default_source;
@@ -1114,7 +1113,6 @@ mail_to_event (ECalClientSourceType source_type,
const gchar *extension_name;
GError *error = NULL;
- folder = e_mail_reader_get_folder (reader);
parent = e_mail_reader_get_window (reader);
uids = e_mail_reader_get_selected_uids (reader);
@@ -1213,7 +1211,7 @@ mail_to_event (ECalClientSourceType source_type,
data = g_new0 (AsyncData, 1);
data->source = g_object_ref (source);
data->source_type = source_type;
- data->folder = g_object_ref (folder);
+ data->folder = e_mail_reader_ref_folder (reader);
data->uids = uids;
data->with_attendees = with_attendees;
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c
index c6a3cab235..efbe222307 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -295,9 +295,6 @@ emla_list_action (EMailReader *reader,
GPtrArray *uids;
const gchar *message_uid;
- folder = e_mail_reader_get_folder (reader);
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
uids = e_mail_reader_get_selected_uids (reader);
g_return_if_fail (uids != NULL && uids->len == 1);
message_uid = g_ptr_array_index (uids, 0);
@@ -310,11 +307,15 @@ emla_list_action (EMailReader *reader,
context->reader = g_object_ref (reader);
context->action = action;
+ folder = e_mail_reader_ref_folder (reader);
+
camel_folder_get_message (
folder, message_uid, G_PRIORITY_DEFAULT,
cancellable, (GAsyncReadyCallback)
emla_list_action_cb, context);
+ g_clear_object (&folder);
+
em_utils_uids_free (uids);
}
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 7a176b4b70..d83e1fbe17 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -994,7 +994,8 @@ action_reply_with_template_cb (GtkAction *action,
EActivity *activity;
AsyncContext *context;
GCancellable *cancellable;
- CamelFolder *folder, *template_folder;
+ CamelFolder *folder;
+ CamelFolder *template_folder;
EShellContent *shell_content;
EMailReader *reader;
GPtrArray *uids;
@@ -1004,9 +1005,6 @@ action_reply_with_template_cb (GtkAction *action,
shell_content = e_shell_view_get_shell_content (shell_view);
reader = E_MAIL_READER (shell_content);
- folder = e_mail_reader_get_folder (reader);
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
-
uids = e_mail_reader_get_selected_uids (reader);
g_return_if_fail (uids != NULL && uids->len == 1);
message_uid = g_ptr_array_index (uids, 0);
@@ -1025,11 +1023,14 @@ action_reply_with_template_cb (GtkAction *action,
context->template_folder = g_object_ref (template_folder);
context->template_message_uid = g_strdup (template_message_uid);
+ folder = e_mail_reader_ref_folder (reader);
+
em_utils_get_real_folder_uri_and_message_uid (
folder, message_uid,
- &context->source_folder_uri, &context->message_uid);
+ &context->source_folder_uri,
+ &context->message_uid);
- if (!context->message_uid)
+ if (context->message_uid == NULL)
context->message_uid = g_strdup (message_uid);
camel_folder_get_message (
@@ -1037,6 +1038,8 @@ action_reply_with_template_cb (GtkAction *action,
cancellable, (GAsyncReadyCallback)
template_got_source_message, context);
+ g_clear_object (&folder);
+
em_utils_uids_free (uids);
}