[calls/wip/ui-manage-accounts: 18/26] account-manager: Add API to query managed credentials




commit 1ee25ee64ac258a246a4e0bbc2e11e2b7b56e880
Author: Evangelos Ribeiro Tzaras <evangelos tzaras puri sm>
Date:   Sat Jun 12 18:03:04 2021 +0200

    account-manager: Add API to query managed credentials
    
    This will be needed in the UI for the per-credentials-widgets.

 src/calls-account-manager.c | 16 ++++++++++++++++
 src/calls-account-manager.h |  1 +
 2 files changed, 17 insertions(+)
---
diff --git a/src/calls-account-manager.c b/src/calls-account-manager.c
index f463c141..f840ddf4 100644
--- a/src/calls-account-manager.c
+++ b/src/calls-account-manager.c
@@ -567,3 +567,19 @@ calls_account_manager_load_from_keyfile (CallsAccountManager *self,
     calls_account_manager_add_credentials (self, credentials);
   }
 }
+
+/**
+ * calls_account_manager_get_credentials_list:
+ * @self: A #CallsAccountManager
+ *
+ * Get the list of #CallsCredentials known to @self
+ *
+ * Returns: (transfer none): A #GListModel of credentials
+ */
+GListModel *
+calls_account_manager_get_credentials_list (CallsAccountManager *self)
+{
+  g_return_val_if_fail (CALLS_IS_ACCOUNT_MANAGER (self), NULL);
+
+  return G_LIST_MODEL (self->credentials);
+}
diff --git a/src/calls-account-manager.h b/src/calls-account-manager.h
index 4102f41c..9bb75bd2 100644
--- a/src/calls-account-manager.h
+++ b/src/calls-account-manager.h
@@ -70,6 +70,7 @@ gboolean                  calls_account_manager_update_credentials       (CallsA
                                                                           CallsCredentials     *new_creds);
 void                      calls_account_manager_load_from_keyfile        (CallsAccountManager  *self,
                                                                           GKeyFile             *key_file);
+GListModel               *calls_account_manager_get_credentials_list     (CallsAccountManager  *self);
 
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]