aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorBharath Acharya <abharath@novell.com>2008-07-21 02:26:42 +0800
committerBharath Acharya <abharath@src.gnome.org>2008-07-21 02:26:42 +0800
commit5948c36901a66021c7d3ded3acaf9bde18be17d2 (patch)
tree960806e80dea92c795ab98ace930034fdb8772ee /mail/em-utils.c
parent474f15f5571bc0d2e64785963703852f274e74df (diff)
downloadgsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.tar
gsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.tar.gz
gsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.tar.bz2
gsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.tar.lz
gsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.tar.xz
gsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.tar.zst
gsoc2013-evolution-5948c36901a66021c7d3ded3acaf9bde18be17d2.zip
** Fixes Bug #200147
2008-07-18 Bharath Acharya <abharath@novell.com> ** Fixes Bug #200147 Basic functionality implemented by Diego Escalante Urrelo <diegoe@gnome.org> Everyone owes him a big mug of Beer for that. ** Added Templates plugin * Makefile.am: * apps-evolution-template-placeholders.schemas.in: * org-gnome-templates.eplug.xml: * templates.c: * templates.glade: svn path=/trunk/; revision=35780
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index ff686f3d8c..4fd8a98958 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1364,7 +1364,53 @@ em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode)
return path;
}
+/** em_utils_folder_is_templates:
+ * @folder: folder
+ * @uri: uri for this folder, if known
+ *
+ * Decides if @folder is a Templates folder.
+ *
+ * Returns %TRUE if this is a Drafts folder or %FALSE otherwise.
+ **/
+
+gboolean
+em_utils_folder_is_templates (CamelFolder *folder, const char *uri)
+{
+ EAccountList *accounts;
+ EAccount *account;
+ EIterator *iter;
+ int is = FALSE;
+ char *templates_uri;
+ if (folder == mail_component_get_folder (NULL, MAIL_COMPONENT_FOLDER_TEMPLATES))
+ return TRUE;
+
+ if (uri == NULL)
+ return FALSE;
+
+ accounts = mail_config_get_accounts();
+ iter = e_list_get_iterator ((EList *)accounts);
+ while (e_iterator_is_valid (iter)) {
+ account = (EAccount *)e_iterator_get (iter);
+
+ if (account->templates_folder_uri) {
+ templates_uri = em_uri_to_camel (account->templates_folder_uri);
+ if (camel_store_folder_uri_equal (folder->parent_store, templates_uri, uri)) {
+ g_free (templates_uri);
+ is = TRUE;
+ break;
+ }
+ g_free (templates_uri);
+ }
+
+ e_iterator_next (iter);
+ }
+
+ g_object_unref (iter);
+
+ return is;
+}
+
/**
* em_utils_folder_is_drafts:
* @folder: folder