diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-03 21:16:49 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:06 +0800 |
commit | bbf5ce3869dbdf1c277ee9d10b07e91fd775502b (patch) | |
tree | 58f626df0ec8780b130eb32eb309b209bd6a4b83 | |
parent | 7ddf79d7ce01de060de6046a01b7f53f6da78ecc (diff) | |
download | gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.tar gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.tar.gz gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.tar.bz2 gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.tar.lz gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.tar.xz gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.tar.zst gsoc2013-evolution-bbf5ce3869dbdf1c277ee9d10b07e91fd775502b.zip |
Drop 'folder_uri' param from em_utils_folder_is_sent().
-rw-r--r-- | mail/e-mail-paned-view.c | 2 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 2 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 2 | ||||
-rw-r--r-- | mail/em-utils.c | 18 | ||||
-rw-r--r-- | mail/em-utils.h | 2 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 3 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 4 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view.c | 4 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 4 |
9 files changed, 21 insertions, 20 deletions
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 06da0a02dd..dc51615a53 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -784,7 +784,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_sent (folder, folder_uri); + em_utils_folder_is_sent (folder); if (e_shell_settings_get_boolean (shell_settings, "mail-global-view-setting")) view_instance = e_shell_view_new_view_instance (shell_view, outgoing_folder ? "global_view_sent_setting" : "global_view_setting"); diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 70bd53daba..af8b2280cf 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -552,7 +552,7 @@ e_mail_reader_create_filter_from_selected (EMailReader *reader, folder = e_mail_reader_get_folder (reader); folder_uri = e_mail_reader_get_folder_uri (reader); - if (em_utils_folder_is_sent (folder, folder_uri)) + if (em_utils_folder_is_sent (folder)) filter_source = E_FILTER_SOURCE_OUTGOING; else if (em_utils_folder_is_outbox (folder, folder_uri)) filter_source = E_FILTER_SOURCE_OUTGOING; diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index c3ad3165ed..4e84b6c1fb 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -2932,7 +2932,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_sent (folder, folder_uri)); + em_utils_folder_is_sent (folder)); /* FIXME Need to pass a GCancellable. */ em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL, NULL); diff --git a/mail/em-utils.c b/mail/em-utils.c index 86b6b812b1..5c8082d6e2 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1113,22 +1113,24 @@ em_utils_folder_is_drafts (CamelFolder *folder) /** * em_utils_folder_is_sent: - * @folder: folder - * @uri: uri for this folder, if known + * @folder: a #CamelFolder * - * Decides if @folder is a Sent folder + * Decides if @folder is a Sent folder. * * Returns %TRUE if this is a Sent folder or %FALSE otherwise. **/ gboolean -em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri) +em_utils_folder_is_sent (CamelFolder *folder) { CamelFolder *local_sent_folder; CamelSession *session; CamelStore *store; EAccountList *account_list; EIterator *iterator; - gint is_sent = FALSE; + gchar *folder_uri; + gboolean is_sent = FALSE; + + g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE); local_sent_folder = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_SENT); @@ -1136,8 +1138,7 @@ em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri) if (folder == local_sent_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)); @@ -1157,7 +1158,7 @@ em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri) sent_uri = em_uri_to_camel ( account->sent_folder_uri); is_sent = e_mail_folder_uri_equal ( - session, sent_uri, uri); + session, sent_uri, folder_uri); g_free (sent_uri); } @@ -1165,6 +1166,7 @@ em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri) } g_object_unref (iterator); + g_free (folder_uri); return is_sent; } diff --git a/mail/em-utils.h b/mail/em-utils.h index 069acb94fb..5ede20792b 100644 --- a/mail/em-utils.h +++ b/mail/em-utils.h @@ -64,7 +64,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, const gchar *uri); +gboolean em_utils_folder_is_sent (CamelFolder *folder); gboolean em_utils_folder_is_outbox (CamelFolder *folder, const gchar *uri); gchar *em_utils_get_proxy_uri (const gchar *uri); diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index c23030bdb4..5dde558b37 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -267,8 +267,7 @@ update_1folder (MailFolderCache *self, || (is_drafts = em_utils_folder_is_drafts (folder)) || (is_outbox = em_utils_folder_is_outbox ( folder, info ? info->uri : NULL)) - || (self->priv->count_sent && em_utils_folder_is_sent ( - folder, info ? info->uri : NULL))) { + || (self->priv->count_sent && em_utils_folder_is_sent (folder))) { d(printf(" total count\n")); unread = camel_folder_get_message_count (folder); if (is_drafts || is_outbox) { diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index b56a5621d2..ed4da52ce2 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -977,7 +977,7 @@ e_mail_shell_view_create_filter_from_selected (EMailShellView *mail_shell_view, folder_uri = e_mail_reader_get_folder_uri (reader); uids = e_mail_reader_get_selected_uids (reader); - if (em_utils_folder_is_sent (folder, folder_uri)) + if (em_utils_folder_is_sent (folder)) filter_source = E_FILTER_SOURCE_OUTGOING; else if (em_utils_folder_is_outbox (folder, folder_uri)) filter_source = E_FILTER_SOURCE_OUTGOING; @@ -1181,7 +1181,7 @@ e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view) num_visible), num_visible); /* "Sent" folder */ - } else if (em_utils_folder_is_sent (folder, folder_uri)) { + } else if (em_utils_folder_is_sent (folder)) { g_string_append_printf ( buffer, ngettext ("%d sent", "%d sent", num_visible), num_visible); diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c index 0b0f13e5d3..1c1a86785e 100644 --- a/modules/mail/e-mail-shell-view.c +++ b/modules/mail/e-mail-shell-view.c @@ -390,7 +390,7 @@ filter: break; case MAIL_FILTER_RECENT_MESSAGES: - if (em_utils_folder_is_sent (folder, folder_uri)) + if (em_utils_folder_is_sent (folder)) temp = g_strdup_printf ( "(and %s (match-all " "(> (get-sent-date) " @@ -407,7 +407,7 @@ filter: break; case MAIL_FILTER_LAST_5_DAYS_MESSAGES: - if (em_utils_folder_is_sent (folder, folder_uri)) + if (em_utils_folder_is_sent (folder)) temp = g_strdup_printf ( "(and %s (match-all " "(> (get-sent-date) " diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index f63f9623ba..a90ff38bbe 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2284,7 +2284,7 @@ in_proper_folder (CamelFolder *folder) /* or any other virtual folder */ CAMEL_IS_VEE_FOLDER (folder) || /* or anything else except of sent, outbox or drafts folder */ - (!em_utils_folder_is_sent (folder, folder_uri) && + (!em_utils_folder_is_sent (folder) && !em_utils_folder_is_outbox (folder, folder_uri) && !em_utils_folder_is_drafts (folder)) )); @@ -2292,7 +2292,7 @@ in_proper_folder (CamelFolder *folder) /* cannot check for Inbox folder here */ res = (folder->folder_flags & (CAMEL_FOLDER_IS_TRASH | CAMEL_FOLDER_IS_JUNK)) == 0 && ( (CAMEL_IS_VEE_FOLDER (folder)) || ( - !em_utils_folder_is_sent (folder, folder_uri) && + !em_utils_folder_is_sent (folder) && !em_utils_folder_is_outbox (folder, folder_uri) && !em_utils_folder_is_drafts (folder))); } |