No issues found
Tool | Failure ID | Location | Function | Message | Data |
---|---|---|---|---|---|
clang-analyzer | no-output-found | e-mail-parser-attachment-bar.c | Message(text='Unable to locate XML output from invoke-clang-analyzer') | None | |
clang-analyzer | no-output-found | e-mail-parser-attachment-bar.c | Message(text='Unable to locate XML output from invoke-clang-analyzer') | None |
1 /*
2 * e-mail-parser-attachment-bar.c
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
16 *
17 */
18
19 #ifdef HAVE_CONFIG_H
20 #include <config.h>
21 #endif
22 #include "e-mail-format-extensions.h"
23
24 #include <glib/gi18n-lib.h>
25 #include "e-mail-part-attachment-bar.h"
26
27 #include <em-format/e-mail-parser-extension.h>
28 #include <em-format/e-mail-parser.h>
29 #include <e-util/e-util.h>
30
31 #include <widgets/misc/e-attachment-bar.h>
32
33 #include <camel/camel.h>
34
35 static void
36 mail_part_attachment_bar_free (EMailPart *part)
37 {
38 EMailPartAttachmentBar *empab = (EMailPartAttachmentBar *) part;
39
40 g_clear_object (&empab->store);
41 }
42
43 /******************************************************************************/
44
45 typedef struct _EMailParserAttachmentBar {
46 GObject parent;
47 } EMailParserAttachmentBar;
48
49 typedef struct _EMailParserAttachmentBarClass {
50 GObjectClass parent_class;
51 } EMailParserAttachmentBarClass;
52
53 static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
54 static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface);
55
56 G_DEFINE_TYPE_EXTENDED (
57 EMailParserAttachmentBar,
58 e_mail_parser_attachment_bar,
59 G_TYPE_OBJECT,
60 0,
61 G_IMPLEMENT_INTERFACE (
62 E_TYPE_MAIL_EXTENSION,
63 e_mail_parser_mail_extension_interface_init)
64 G_IMPLEMENT_INTERFACE (
65 E_TYPE_MAIL_PARSER_EXTENSION,
66 e_mail_parser_parser_extension_interface_init))
67
68 static const gchar *parser_mime_types[] = { "application/vnd.evolution.widget.attachment-bar", NULL };
69
70 static GSList *
71 empe_attachment_bar_parse (EMailParserExtension *extension,
72 EMailParser *parser,
73 CamelMimePart *part,
74 GString *part_id,
75 GCancellable *cancellable)
76 {
77 EMailPartAttachmentBar *empab;
78 gint len;
79
80 len = part_id->len;
81 g_string_append (part_id, ".attachment-bar");
82 empab = (EMailPartAttachmentBar *) e_mail_part_subclass_new (
83 part, part_id->str, sizeof (EMailPartAttachmentBar),
84 (GFreeFunc) mail_part_attachment_bar_free);
85 empab->parent.mime_type = g_strdup ("application/vnd.evolution.widget.attachment-bar");
86 empab->store = E_ATTACHMENT_STORE (e_attachment_store_new ());
87 g_string_truncate (part_id, len);
88
89 return g_slist_append (NULL, empab);
90 }
91
92 static const gchar **
93 empe_attachment_bar_mime_types (EMailExtension *extension)
94 {
95 return parser_mime_types;
96 }
97
98 static void
99 e_mail_parser_attachment_bar_class_init (EMailParserAttachmentBarClass *class)
100 {
101 }
102
103 static void
104 e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
105 {
106 iface->parse = empe_attachment_bar_parse;
107 }
108
109 static void
110 e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface)
111 {
112 iface->mime_types = empe_attachment_bar_mime_types;
113 }
114
115 static void
116 e_mail_parser_attachment_bar_init (EMailParserAttachmentBar *parser)
117 {
118
119 }