No issues found
Tool | Failure ID | Location | Function | Message | Data |
---|---|---|---|---|---|
clang-analyzer | no-output-found | e-mail-config-reader.c | Message(text='Unable to locate XML output from invoke-clang-analyzer') | None | |
clang-analyzer | no-output-found | e-mail-config-reader.c | Message(text='Unable to locate XML output from invoke-clang-analyzer') | None |
1 /*
2 * e-mail-config-reader.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
23 #include "e-mail-config-reader.h"
24
25 #include <shell/e-shell.h>
26 #include <mail/e-mail-reader.h>
27
28 #define E_MAIL_CONFIG_READER_GET_PRIVATE(obj) \
29 (G_TYPE_INSTANCE_GET_PRIVATE \
30 ((obj), E_TYPE_MAIL_CONFIG_READER, EMailConfigReaderPrivate))
31
32 struct _EMailConfigReaderPrivate {
33 gint placeholder;
34 };
35
36 G_DEFINE_DYNAMIC_TYPE (
37 EMailConfigReader,
38 e_mail_config_reader,
39 E_TYPE_EXTENSION)
40
41 static gboolean
42 mail_config_reader_idle_cb (EExtension *extension)
43 {
44 EExtensible *extensible;
45 GtkActionGroup *action_group;
46 EShellSettings *shell_settings;
47 ESourceRegistry *registry;
48 ESource *source;
49 EShell *shell;
50
51 extensible = e_extension_get_extensible (extension);
52
53 shell = e_shell_get_default ();
54 registry = e_shell_get_registry (shell);
55 shell_settings = e_shell_get_shell_settings (shell);
56
57 g_object_bind_property (
58 shell_settings, "mail-forward-style",
59 extensible, "forward-style",
60 G_BINDING_SYNC_CREATE);
61
62 g_object_bind_property (
63 shell_settings, "mail-reply-style",
64 extensible, "reply-style",
65 G_BINDING_SYNC_CREATE);
66
67 action_group = e_mail_reader_get_action_group (
68 E_MAIL_READER (extensible),
69 E_MAIL_READER_ACTION_GROUP_SEARCH_FOLDERS);
70
71 source = e_source_registry_ref_source (registry, "vfolder");
72
73 g_object_bind_property (
74 source, "enabled",
75 action_group, "visible",
76 G_BINDING_SYNC_CREATE);
77
78 g_object_unref (source);
79
80 return FALSE;
81 }
82
83 static void
84 mail_config_reader_constructed (GObject *object)
85 {
86 /* Bind properties to settings from an idle callback so the
87 * EMailReader interface has a chance to be initialized first.
88 * Prioritize ahead of GTK+ redraws. */
89 g_idle_add_full (
90 G_PRIORITY_HIGH_IDLE,
91 (GSourceFunc) mail_config_reader_idle_cb,
92 g_object_ref (object),
93 (GDestroyNotify) g_object_unref);
94
95 /* Chain up to parent's constructed() method. */
96 G_OBJECT_CLASS (e_mail_config_reader_parent_class)->
97 constructed (object);
98 }
99
100 static void
101 e_mail_config_reader_class_init (EMailConfigReaderClass *class)
102 {
103 GObjectClass *object_class;
104 EExtensionClass *extension_class;
105
106 g_type_class_add_private (class, sizeof (EMailConfigReaderPrivate));
107
108 object_class = G_OBJECT_CLASS (class);
109 object_class->constructed = mail_config_reader_constructed;
110
111 extension_class = E_EXTENSION_CLASS (class);
112 extension_class->extensible_type = E_TYPE_MAIL_READER;
113 }
114
115 static void
116 e_mail_config_reader_class_finalize (EMailConfigReaderClass *class)
117 {
118 }
119
120 static void
121 e_mail_config_reader_init (EMailConfigReader *extension)
122 {
123 extension->priv = E_MAIL_CONFIG_READER_GET_PRIVATE (extension);
124 }
125
126 void
127 e_mail_config_reader_type_register (GTypeModule *type_module)
128 {
129 /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration
130 * function, so we have to wrap it with a public function in
131 * order to register types from a separate compilation unit. */
132 e_mail_config_reader_register_type (type_module);
133 }