gboolean match = FALSE;
gchar *address;
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
ESourceMailIdentity *extension;
const gchar *address;
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension = e_source_get_extension (source, extension_name);
for (link = list; link != NULL; link = g_list_next (link)) {
ESource *candidate = E_SOURCE (link->data);
- if (e_source_get_enabled (candidate)) {
+ if (e_source_registry_check_enabled (registry, candidate)) {
source = g_object_ref (candidate);
break;
}
type_ahead_complete_on_timeout_cb, name_selector_entry);
}
-static gboolean
-is_source_enabled_with_parents (ESourceRegistry *registry,
- ESource *source)
-{
- ESource *parent;
- const gchar *parent_uid;
-
- g_return_val_if_fail (registry != NULL, FALSE);
- g_return_val_if_fail (source != NULL, FALSE);
-
- if (!e_source_get_enabled (source))
- return FALSE;
-
- parent = g_object_ref (source);
- while (parent_uid = e_source_get_parent (parent), parent_uid) {
- ESource *next = e_source_registry_ref_source (registry, parent_uid);
-
- if (!next)
- break;
-
- g_object_unref (parent);
-
- if (!e_source_get_enabled (next)) {
- g_object_unref (next);
- return FALSE;
- }
-
- parent = next;
- }
-
- g_object_unref (parent);
-
- return TRUE;
-}
-
static void
setup_contact_store (ENameSelectorEntry *name_selector_entry)
{
extension = e_source_get_extension (source, extension_name);
/* Skip disabled address books. */
- if (!is_source_enabled_with_parents (registry, source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
/* Skip non-completion address books. */
G_DEFINE_TYPE (ENameSelector, e_name_selector, G_TYPE_OBJECT)
-static gboolean
-is_source_enabled_with_parents (ESourceRegistry *registry,
- ESource *source)
-{
- ESource *parent;
- const gchar *parent_uid;
-
- g_return_val_if_fail (registry != NULL, FALSE);
- g_return_val_if_fail (source != NULL, FALSE);
-
- if (!e_source_get_enabled (source))
- return FALSE;
-
- parent = g_object_ref (source);
- while (parent_uid = e_source_get_parent (parent), parent_uid) {
- ESource *next = e_source_registry_ref_source (registry, parent_uid);
-
- if (!next)
- break;
-
- g_object_unref (parent);
-
- if (!e_source_get_enabled (next)) {
- g_object_unref (next);
- return FALSE;
- }
-
- parent = next;
- }
-
- g_object_unref (parent);
-
- return TRUE;
-}
-
static void
reset_pointer_cb (gpointer data,
GObject *where_was)
extension = e_source_get_extension (source, extension_name);
/* Skip disabled address books. */
- if (!is_source_enabled_with_parents (registry, source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
/* Only load address books with autocomplete enabled,