aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-03 21:40:49 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-03 21:42:06 +0800
commitc3b983d6e12e218b6f908cf263e7e08570332d6a (patch)
tree560030902b043570bfaf391f40dd40b185ccec9b
parentb9f932b1b84349e80e8383d925a00a75a3b7fe29 (diff)
downloadgsoc2013-evolution-c3b983d6e12e218b6f908cf263e7e08570332d6a.tar.gz
gsoc2013-evolution-c3b983d6e12e218b6f908cf263e7e08570332d6a.tar.zst
gsoc2013-evolution-c3b983d6e12e218b6f908cf263e7e08570332d6a.zip
Drop 'folder_uri' param from em_utils_folder_is_outbox().
-rw-r--r--mail/e-mail-folder-pane.c4
-rw-r--r--mail/e-mail-paned-view.c2
-rw-r--r--mail/e-mail-reader-utils.c6
-rw-r--r--mail/e-mail-reader.c4
-rw-r--r--mail/e-mail-sidebar.c6
-rw-r--r--mail/em-folder-tree-model.c2
-rw-r--r--mail/em-utils.c26
-rw-r--r--mail/em-utils.h2
-rw-r--r--mail/mail-folder-cache.c3
-rw-r--r--modules/mail/e-mail-shell-view-private.c4
-rw-r--r--plugins/itip-formatter/itip-formatter.c4
11 files changed, 25 insertions, 38 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);
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index ed4da52ce2..c6a034bf40 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -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);
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index a90ff38bbe..96dadab0ea 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -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)));
}