Commit bbf5ce38 authored by Matthew Barnes's avatar Matthew Barnes Committed by Rodrigo Moya
Browse files

Drop 'folder_uri' param from em_utils_folder_is_sent().

parent 7ddf79d7
......@@ -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");
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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) "
......
......@@ -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)));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment