aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-03 21:07:26 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-03 21:42:06 +0800
commitc694ca567b0339afea05d1e36a74290a7cd06944 (patch)
treec17beac00c8077f51b92a9fc305a35ed908b78a6 /mail/em-utils.c
parent9e0f0f529f363717fa0a2884fe576d8a26ed3df2 (diff)
downloadgsoc2013-evolution-c694ca567b0339afea05d1e36a74290a7cd06944.tar.gz
gsoc2013-evolution-c694ca567b0339afea05d1e36a74290a7cd06944.tar.zst
gsoc2013-evolution-c694ca567b0339afea05d1e36a74290a7cd06944.zip
Drop 'folder_uri' param from em_utils_folder_is_templates().
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index ba496dcae9..86b6b812b1 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -992,23 +992,25 @@ em_utils_selection_get_urilist (GtkSelectionData *selection_data,
/**
* em_utils_folder_is_templates:
- * @folder: folder
- * @uri: uri for this folder, if known
+ * @folder: a #CamelFolder
*
* Decides if @folder is a Templates folder.
*
- * Returns %TRUE if this is a Drafts folder or %FALSE otherwise.
+ * Returns %TRUE if this is a Templates folder or %FALSE otherwise.
**/
gboolean
-em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri)
+em_utils_folder_is_templates (CamelFolder *folder)
{
CamelFolder *local_templates_folder;
CamelSession *session;
CamelStore *store;
EAccountList *account_list;
EIterator *iterator;
- gint is_templates = FALSE;
+ gchar *folder_uri;
+ gboolean is_templates = FALSE;
+
+ g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
local_templates_folder =
e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_TEMPLATES);
@@ -1016,8 +1018,7 @@ em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri)
if (folder == local_templates_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));
@@ -1037,7 +1038,7 @@ em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri)
templates_uri = em_uri_to_camel (
account->templates_folder_uri);
is_templates = e_mail_folder_uri_equal (
- session, templates_uri, uri);
+ session, templates_uri, folder_uri);
g_free (templates_uri);
}
@@ -1045,6 +1046,7 @@ em_utils_folder_is_templates (CamelFolder *folder, const gchar *uri)
}
g_object_unref (iterator);
+ g_free (folder_uri);
return is_templates;
}