diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-folder-pane.c | 2 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 2 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 2 | ||||
-rw-r--r-- | mail/em-utils.c | 18 | ||||
-rw-r--r-- | mail/em-utils.h | 2 |
5 files changed, 14 insertions, 12 deletions
diff --git a/mail/e-mail-folder-pane.c b/mail/e-mail-folder-pane.c index 4035e48ae7..ec64f8140c 100644 --- a/mail/e-mail-folder-pane.c +++ b/mail/e-mail-folder-pane.c @@ -92,7 +92,7 @@ mail_paned_view_open_selected_mail (EMailPanedView *view) folder_uri = e_mail_reader_get_folder_uri (reader); if (em_utils_folder_is_drafts (folder) || em_utils_folder_is_outbox (folder, folder_uri) || - em_utils_folder_is_templates (folder, folder_uri)) { + em_utils_folder_is_templates (folder)) { em_utils_edit_messages (shell, folder, uids, TRUE); return 0; } diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 9be062d9c9..70bd53daba 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -243,7 +243,7 @@ e_mail_reader_open_selected (EMailReader *reader) if (em_utils_folder_is_drafts (folder) || em_utils_folder_is_outbox (folder, folder_uri) || - em_utils_folder_is_templates (folder, folder_uri)) { + em_utils_folder_is_templates (folder)) { em_utils_edit_messages (shell, folder, uids, TRUE); return uids->len; } diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 68d5c004d7..2d3e7de605 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1117,7 +1117,7 @@ edit_message (EShell *shell, EMsgComposer *composer; /* Template specific code follows. */ - if (em_utils_folder_is_templates (folder, NULL)) { + if (em_utils_folder_is_templates (folder)) { GConfClient *gconf; GSList *clue_list = NULL; diff --git a/mail/em-utils.c b/mail/em-utils.c index ba496dcae9..86b6b812b1 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -992,23 +992,25 @@ em_utils_selection_get_urilist (GtkSelectionData *selection_data, /** * em_utils_folder_is_templates: - * @folder: folder - * @uri: uri for this folder, if known + * @folder: a #CamelFolder * * Decides if @folder is a Templates folder. * - * Returns %TRUE if this is a Drafts folder or %FALSE otherwise. + * Returns %TRUE if this is a Templates folder or %FALSE otherwise. **/ gboolean -em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri) +em_utils_folder_is_templates (CamelFolder *folder) { CamelFolder *local_templates_folder; CamelSession *session; CamelStore *store; EAccountList *account_list; EIterator *iterator; - gint is_templates = FALSE; + gchar *folder_uri; + gboolean is_templates = FALSE; + + g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE); local_templates_folder = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_TEMPLATES); @@ -1016,8 +1018,7 @@ em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri) if (folder == local_templates_folder) return TRUE; - if (folder == NULL || uri == NULL) - return FALSE; + folder_uri = e_mail_folder_uri_from_folder (folder); store = camel_folder_get_parent_store (folder); session = camel_service_get_session (CAMEL_SERVICE (store)); @@ -1037,7 +1038,7 @@ em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri) templates_uri = em_uri_to_camel ( account->templates_folder_uri); is_templates = e_mail_folder_uri_equal ( - session, templates_uri, uri); + session, templates_uri, folder_uri); g_free (templates_uri); } @@ -1045,6 +1046,7 @@ em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri) } g_object_unref (iterator); + g_free (folder_uri); return is_templates; } diff --git a/mail/em-utils.h b/mail/em-utils.h index 744bfe64c3..069acb94fb 100644 --- a/mail/em-utils.h +++ b/mail/em-utils.h @@ -63,7 +63,7 @@ void em_utils_selection_set_urilist (GtkSelectionData *data, CamelFolder *folder void em_utils_selection_get_urilist (GtkSelectionData *data, CamelFolder *folder); gboolean em_utils_folder_is_drafts (CamelFolder *folder); -gboolean em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri); +gboolean em_utils_folder_is_templates (CamelFolder *folder); gboolean em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri); gboolean em_utils_folder_is_outbox (CamelFolder *folder, const gchar *uri); |