diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-06-06 00:41:59 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-06-06 01:03:46 +0800 |
commit | 900ea24740c39ac60dc1763fedb03cfa3e865b86 (patch) | |
tree | 3fa2d3d07b19405c578afa00a25cfdc5b4850e12 /mail | |
parent | 3e8b6ddf8d9e090e0769faede1d68337e240e58d (diff) | |
download | gsoc2013-evolution-900ea24740c39ac60dc1763fedb03cfa3e865b86.tar.gz gsoc2013-evolution-900ea24740c39ac60dc1763fedb03cfa3e865b86.tar.zst gsoc2013-evolution-900ea24740c39ac60dc1763fedb03cfa3e865b86.zip |
Remove EMailReaderHeader struct.
No longer used.
Also remove related helper functions:
e_mail_reader_header_from_xml()
e_mail_reader_header_to_xml()
e_mail_reader_header_free()
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-reader-utils.c | 109 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.h | 13 |
2 files changed, 0 insertions, 122 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index d1b8d88e8a..8a711a52a1 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -2350,115 +2350,6 @@ e_mail_reader_create_vfolder_from_selected (EMailReader *reader, em_utils_uids_free (uids); } -static EMailReaderHeader * -emr_header_from_xmldoc (xmlDocPtr doc) -{ - EMailReaderHeader *h; - xmlNodePtr root; - xmlChar *name; - - if (doc == NULL) - return NULL; - - root = doc->children; - if (strcmp ((gchar *) root->name, "header") != 0) - return NULL; - - name = xmlGetProp (root, (const guchar *)"name"); - if (name == NULL) - return NULL; - - h = g_malloc0 (sizeof (EMailReaderHeader)); - h->name = g_strdup ((gchar *) name); - xmlFree (name); - - if (xmlHasProp (root, (const guchar *)"enabled")) - h->enabled = 1; - else - h->enabled = 0; - - return h; -} - -/** - * e_mail_reader_header_from_xml - * @xml: XML configuration data - * - * Parses passed XML data, which should be of - * the format <header name="foo" enabled />, and - * returns a EMailReaderHeader structure, or NULL if there - * is an error. - **/ -EMailReaderHeader * -e_mail_reader_header_from_xml (const gchar *xml) -{ - EMailReaderHeader *header; - xmlDocPtr doc; - - if (!(doc = xmlParseDoc ((guchar *) xml))) - return NULL; - - header = emr_header_from_xmldoc (doc); - xmlFreeDoc (doc); - - return header; -} - -/** - * e_mail_reader_header_to_xml - * @header: header from which to generate XML - * - * Returns the passed header as a XML structure, - * or NULL on error - */ -gchar * -e_mail_reader_header_to_xml (EMailReaderHeader *header) -{ - xmlDocPtr doc; - xmlNodePtr root; - xmlChar *xml; - gchar *out; - gint size; - - g_return_val_if_fail (header != NULL, NULL); - g_return_val_if_fail (header->name != NULL, NULL); - - doc = xmlNewDoc ((const guchar *)"1.0"); - - root = xmlNewDocNode (doc, NULL, (const guchar *)"header", NULL); - xmlSetProp (root, (const guchar *)"name", (guchar *) header->name); - if (header->enabled) - xmlSetProp (root, (const guchar *)"enabled", NULL); - - xmlDocSetRootElement (doc, root); - xmlDocDumpMemory (doc, &xml, &size); - xmlFreeDoc (doc); - - out = g_malloc (size + 1); - memcpy (out, xml, size); - out[size] = '\0'; - xmlFree (xml); - - return out; -} - -/** - * e_mail_reader_header_free - * @header: header to free - * - * Frees the memory associated with the passed header - * structure. - */ -void -e_mail_reader_header_free (EMailReaderHeader *header) -{ - if (header == NULL) - return; - - g_free (header->name); - g_free (header); -} - static void mail_reader_parse_message_run (GSimpleAsyncResult *simple, GObject *object, diff --git a/mail/e-mail-reader-utils.h b/mail/e-mail-reader-utils.h index 692622c134..0c97c882d5 100644 --- a/mail/e-mail-reader-utils.h +++ b/mail/e-mail-reader-utils.h @@ -28,14 +28,6 @@ G_BEGIN_DECLS -typedef struct _EMailReaderHeader EMailReaderHeader; - -struct _EMailReaderHeader { - gchar *name; - guint enabled : 1; - guint is_default : 1; -}; - gboolean e_mail_reader_confirm_delete (EMailReader *reader); void e_mail_reader_delete_folder (EMailReader *reader, CamelFolder *folder); @@ -91,11 +83,6 @@ void e_mail_reader_create_vfolder_from_selected (EMailReader *reader, gint filter_type); -EMailReaderHeader * - e_mail_reader_header_from_xml (const gchar *xml); -gchar * e_mail_reader_header_to_xml (EMailReaderHeader *header); -void e_mail_reader_header_free (EMailReaderHeader *header); - void e_mail_reader_parse_message (EMailReader *reader, CamelFolder *folder, const gchar *message_uid, |