evolution-3.6.4/libemail-engine/e-mail-junk-filter.c

No issues found

Incomplete coverage

Tool Failure ID Location Function Message Data
clang-analyzer no-output-found e-mail-junk-filter.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
clang-analyzer no-output-found e-mail-junk-filter.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
 1 /*
 2  * e-mail-junk-filter.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 #include "e-mail-junk-filter.h"
20 
21 #include <libemail-engine/e-mail-session.h>
22 
23 G_DEFINE_ABSTRACT_TYPE (
24 	EMailJunkFilter,
25 	e_mail_junk_filter,
26 	E_TYPE_EXTENSION)
27 
28 static void
29 e_mail_junk_filter_class_init (EMailJunkFilterClass *class)
30 {
31 	EExtensionClass *extension_class;
32 
33 	extension_class = E_EXTENSION_CLASS (class);
34 	extension_class->extensible_type = E_TYPE_MAIL_SESSION;
35 }
36 
37 static void
38 e_mail_junk_filter_init (EMailJunkFilter *junk_filter)
39 {
40 }
41 
42 gboolean
43 e_mail_junk_filter_available (EMailJunkFilter *junk_filter)
44 {
45 	EMailJunkFilterClass *class;
46 
47 	g_return_val_if_fail (E_IS_MAIL_JUNK_FILTER (junk_filter), FALSE);
48 
49 	class = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter);
50 	g_return_val_if_fail (class->available != NULL, FALSE);
51 
52 	return class->available (junk_filter);
53 }
54 
55 GtkWidget *
56 e_mail_junk_filter_new_config_widget (EMailJunkFilter *junk_filter)
57 {
58 	EMailJunkFilterClass *class;
59 	GtkWidget *widget = NULL;
60 
61 	g_return_val_if_fail (E_IS_MAIL_JUNK_FILTER (junk_filter), NULL);
62 
63 	class = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter);
64 
65 	if (class->new_config_widget != NULL)
66 		widget = class->new_config_widget (junk_filter);
67 
68 	return widget;
69 }
70 
71 gint
72 e_mail_junk_filter_compare (EMailJunkFilter *junk_filter_a,
73                             EMailJunkFilter *junk_filter_b)
74 {
75 	EMailJunkFilterClass *class_a;
76 	EMailJunkFilterClass *class_b;
77 
78 	class_a = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter_a);
79 	class_b = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter_b);
80 
81 	return g_utf8_collate (class_a->display_name, class_b->display_name);
82 }