From cc3a562f03ed7f4f742753e26f2817c70ea4d0a3 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sun, 4 Jul 2021 01:41:35 +0200 Subject: [PATCH] manager: Add API to query loaded providers --- src/calls-manager.c | 17 +++++++++++++++++ src/calls-manager.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/calls-manager.c b/src/calls-manager.c index 9e50016..1e82995 100644 --- a/src/calls-manager.c +++ b/src/calls-manager.c @@ -949,3 +949,20 @@ calls_manager_get_provider_names (CallsManager *self, return (const char **) g_hash_table_get_keys_as_array (self->providers, length); } + +/** + * calls_manager_get_providers: + * @self: A #CallsManager + * + * Get the currently loaded providers + * + * Returns: (transfer container): A #GList of #CallsProvider. + * Use g_list_free() when done using the list. + */ +GList * +calls_manager_get_providers (CallsManager *self) +{ + g_return_val_if_fail (CALLS_IS_MANAGER (self), NULL); + + return g_hash_table_get_values (self->providers); +} diff --git a/src/calls-manager.h b/src/calls-manager.h index d7f6261..b80f853 100644 --- a/src/calls-manager.h +++ b/src/calls-manager.h @@ -72,5 +72,6 @@ void calls_manager_hang_up_all_calls (CallsManager *sel gboolean calls_manager_has_any_provider (CallsManager *self); const char **calls_manager_get_provider_names (CallsManager *self, guint *length); +GList *calls_manager_get_providers (CallsManager *self); G_END_DECLS