diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-03 21:40:49 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:06 +0800 |
commit | fc1034551ed2daf3040851e818b2798c3c58f4f9 (patch) | |
tree | 90696864875650f5fe3759aff3eb19c6181d78a6 /mail | |
parent | bbf5ce3869dbdf1c277ee9d10b07e91fd775502b (diff) | |
download | gsoc2013-evolution-fc1034551ed2daf3040851e818b2798c3c58f4f9.tar.gz gsoc2013-evolution-fc1034551ed2daf3040851e818b2798c3c58f4f9.tar.zst gsoc2013-evolution-fc1034551ed2daf3040851e818b2798c3c58f4f9.zip |
Drop 'folder_uri' param from em_utils_folder_is_outbox().
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-folder-pane.c | 4 | ||||
-rw-r--r-- | mail/e-mail-paned-view.c | 2 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 6 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 4 | ||||
-rw-r--r-- | mail/e-mail-sidebar.c | 6 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 2 | ||||
-rw-r--r-- | mail/em-utils.c | 26 | ||||
-rw-r--r-- | mail/em-utils.h | 2 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 3 |
9 files changed, 21 insertions, 34 deletions
diff --git a/mail/e-mail-folder-pane.c b/mail/e-mail-folder-pane.c index ec64f8140c..1527b14771 100644 --- a/mail/e-mail-folder-pane.c +++ b/mail/e-mail-folder-pane.c @@ -91,7 +91,7 @@ mail_paned_view_open_selected_mail (EMailPanedView *view) folder = e_mail_reader_get_folder (reader); 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_outbox (folder) || em_utils_folder_is_templates (folder)) { em_utils_edit_messages (shell, folder, uids, TRUE); return 0; @@ -121,7 +121,7 @@ mail_paned_view_open_selected_mail (EMailPanedView *view) real_folder_uri = camel_folder_get_uri (real_folder); if (em_utils_folder_is_drafts (real_folder) || - em_utils_folder_is_outbox (real_folder, real_folder_uri)) { + em_utils_folder_is_outbox (real_folder)) { GPtrArray *edits; edits = g_ptr_array_new (); diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index dc51615a53..e91050b499 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -783,7 +783,7 @@ mail_paned_view_update_view_instance (EMailView *view) outgoing_folder = em_utils_folder_is_drafts (folder) || - em_utils_folder_is_outbox (folder, folder_uri) || + em_utils_folder_is_outbox (folder) || em_utils_folder_is_sent (folder); if (e_shell_settings_get_boolean (shell_settings, "mail-global-view-setting")) diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index af8b2280cf..cccc728cd3 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -242,7 +242,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_outbox (folder) || em_utils_folder_is_templates (folder)) { em_utils_edit_messages (shell, folder, uids, TRUE); return uids->len; @@ -273,7 +273,7 @@ e_mail_reader_open_selected (EMailReader *reader) real_folder_uri = camel_folder_get_uri (real_folder); if (em_utils_folder_is_drafts (real_folder) || - em_utils_folder_is_outbox (real_folder, real_folder_uri)) { + em_utils_folder_is_outbox (real_folder)) { GPtrArray *edits; edits = g_ptr_array_new (); @@ -554,7 +554,7 @@ e_mail_reader_create_filter_from_selected (EMailReader *reader, if (em_utils_folder_is_sent (folder)) filter_source = E_FILTER_SOURCE_OUTGOING; - else if (em_utils_folder_is_outbox (folder, folder_uri)) + else if (em_utils_folder_is_outbox (folder)) filter_source = E_FILTER_SOURCE_OUTGOING; else filter_source = E_FILTER_SOURCE_INCOMING; diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 4e84b6c1fb..e0ef3940c0 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2931,7 +2931,7 @@ mail_reader_set_folder (EMailReader *reader, outgoing = folder != NULL && folder_uri != NULL && ( em_utils_folder_is_drafts (folder) || - em_utils_folder_is_outbox (folder, folder_uri) || + em_utils_folder_is_outbox (folder) || em_utils_folder_is_sent (folder)); /* FIXME Need to pass a GCancellable. */ @@ -3807,7 +3807,7 @@ e_mail_reader_check_state (EMailReader *reader) drafts_or_outbox = em_utils_folder_is_drafts (folder) || - em_utils_folder_is_outbox (folder, folder_uri); + em_utils_folder_is_outbox (folder); /* Initialize this flag based on whether there are any * messages selected. We will update it in the loop. */ diff --git a/mail/e-mail-sidebar.c b/mail/e-mail-sidebar.c index 9f44f9e1a2..f9cb30eab2 100644 --- a/mail/e-mail-sidebar.c +++ b/mail/e-mail-sidebar.c @@ -342,15 +342,17 @@ mail_sidebar_check_state (EMailSidebar *sidebar) allows_children = !(is_junk || is_trash); /* Don't allow deletion of special local folders. */ - if (store == local_store) + if (store == local_store) { can_delete = (strcmp (full_name, "Drafts") != 0) && (strcmp (full_name, "Inbox") != 0) && (strcmp (full_name, "Outbox") != 0) && (strcmp (full_name, "Sent") != 0) && (strcmp (full_name, "Templates") != 0); + is_outbox = + (strcmp (full_name, "Outbox") == 0); + } - is_outbox = em_utils_folder_is_outbox (NULL, uri); can_delete &= !(folder_flags & CAMEL_FOLDER_SYSTEM); } diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 4240dc06f0..c989d4e205 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -696,7 +696,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, folder_cache, fi->uri, &folder) && folder) { is_drafts = em_utils_folder_is_drafts (folder); - if (is_drafts || em_utils_folder_is_outbox (folder, fi->uri)) { + if (is_drafts || em_utils_folder_is_outbox (folder)) { gint total; if ((total = camel_folder_get_message_count (folder)) > 0) { diff --git a/mail/em-utils.c b/mail/em-utils.c index 5c8082d6e2..61b5baabc1 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1173,37 +1173,23 @@ em_utils_folder_is_sent (CamelFolder *folder) /** * em_utils_folder_is_outbox: - * @folder: folder - * @uri: uri for this folder, if known + * @folder: a #CamelFolder * - * Decides if @folder is an Outbox folder + * Decides if @folder is an Outbox folder. * * Returns %TRUE if this is an Outbox folder or %FALSE otherwise. **/ gboolean -em_utils_folder_is_outbox (CamelFolder *folder, const gchar *uri) +em_utils_folder_is_outbox (CamelFolder *folder) { CamelFolder *local_outbox_folder; - CamelSession *session; - CamelStore *store; - const gchar *local_outbox_folder_uri; + + g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE); local_outbox_folder = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_OUTBOX); - local_outbox_folder_uri = - e_mail_local_get_folder_uri (E_MAIL_LOCAL_FOLDER_OUTBOX); - - if (folder == local_outbox_folder) - return TRUE; - - if (uri == NULL) - return FALSE; - - store = camel_folder_get_parent_store (local_outbox_folder); - session = camel_service_get_session (CAMEL_SERVICE (store)); - return e_mail_folder_uri_equal ( - session, local_outbox_folder_uri, uri); + return (folder == local_outbox_folder); } /* ********************************************************************** */ diff --git a/mail/em-utils.h b/mail/em-utils.h index 5ede20792b..7f5adf3250 100644 --- a/mail/em-utils.h +++ b/mail/em-utils.h @@ -65,7 +65,7 @@ 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); gboolean em_utils_folder_is_sent (CamelFolder *folder); -gboolean em_utils_folder_is_outbox (CamelFolder *folder, const gchar *uri); +gboolean em_utils_folder_is_outbox (CamelFolder *folder); gchar *em_utils_get_proxy_uri (const gchar *uri); diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 5dde558b37..dff0e00ea8 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -265,8 +265,7 @@ update_1folder (MailFolderCache *self, d(printf("update 1 folder '%s'\n", folder->full_name)); if ((self->priv->count_trash && (CAMEL_IS_VTRASH_FOLDER (folder))) || (is_drafts = em_utils_folder_is_drafts (folder)) - || (is_outbox = em_utils_folder_is_outbox ( - folder, info ? info->uri : NULL)) + || (is_outbox = em_utils_folder_is_outbox (folder)) || (self->priv->count_sent && em_utils_folder_is_sent (folder))) { d(printf(" total count\n")); unread = camel_folder_get_message_count (folder); |