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

Drop 'folder_uri' param from em_utils_folder_is_outbox().

parent bbf5ce38
......@@ -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 ();
......
......@@ -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"))
......
......@@ -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;
......
......@@ -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. */
......
......@@ -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);
}
......
......@@ -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) {
......
......@@ -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);
}
/* ********************************************************************** */
......
......@@ -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);
......
......@@ -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);
......
......@@ -979,7 +979,7 @@ e_mail_shell_view_create_filter_from_selected (EMailShellView *mail_shell_view,
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;
......@@ -1175,7 +1175,7 @@ e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view)
num_visible), num_visible);
/* "Outbox" folder */
} else if (em_utils_folder_is_outbox (folder, folder_uri)) {
} else if (em_utils_folder_is_outbox (folder)) {
g_string_append_printf (
buffer, ngettext ("%d unsent", "%d unsent",
num_visible), num_visible);
......
......@@ -2285,7 +2285,7 @@ in_proper_folder (CamelFolder *folder)
CAMEL_IS_VEE_FOLDER (folder) ||
/* or anything else except of sent, outbox or drafts folder */
(!em_utils_folder_is_sent (folder) &&
!em_utils_folder_is_outbox (folder, folder_uri) &&
!em_utils_folder_is_outbox (folder) &&
!em_utils_folder_is_drafts (folder))
));
} else {
......@@ -2293,7 +2293,7 @@ in_proper_folder (CamelFolder *folder)
res = (folder->folder_flags & (CAMEL_FOLDER_IS_TRASH | CAMEL_FOLDER_IS_JUNK)) == 0 && (
(CAMEL_IS_VEE_FOLDER (folder)) || (
!em_utils_folder_is_sent (folder) &&
!em_utils_folder_is_outbox (folder, folder_uri) &&
!em_utils_folder_is_outbox (folder) &&
!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