summaryrefslogtreecommitdiff
path: root/gcr/gcr-import-interaction.c
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2021-12-10 09:10:40 +0100
committerCorentin Noël <tintou@noel.tf>2022-04-09 00:44:24 +0200
commitbae98bd429f1527d69e1ed30ba0de94f311f47dd (patch)
tree3b55e76b267d6c564a58c924fa44652c13aff035 /gcr/gcr-import-interaction.c
parent964f3a3eaccfeee980e008958611195724bc0696 (diff)
downloadgcr-bae98bd429f1527d69e1ed30ba0de94f311f47dd.tar.gz
gcr-import-interaction: Use G_DECLARE_INTERFACE to define the interface
This means that GcrImportInteractionIface becomes GcrImportInteractionInterface and GCR_IMPORT_INTERACTION_GET_INTERFACE becomes GCR_IMPORT_INTERACTION_GET_IFACE. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Diffstat (limited to 'gcr/gcr-import-interaction.c')
-rw-r--r--gcr/gcr-import-interaction.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/gcr/gcr-import-interaction.c b/gcr/gcr-import-interaction.c
index b8da073..edf0675 100644
--- a/gcr/gcr-import-interaction.c
+++ b/gcr/gcr-import-interaction.c
@@ -33,7 +33,7 @@
*/
/**
- * GcrImportInteractionIface:
+ * GcrImportInteractionInterface:
* @parent: parent interface
* @supplement_prep: method which prepares for supplementing the given attributes before import
* @supplement: method which synchronously supplements attributes before import
@@ -43,18 +43,11 @@
* Interface implemented by implementations of [iface@ImportInteraction].
*/
-typedef GcrImportInteractionIface GcrImportInteractionInterface;
-
G_DEFINE_INTERFACE (GcrImportInteraction, gcr_import_interaction, G_TYPE_TLS_INTERACTION);
static void
-gcr_import_interaction_default_init (GcrImportInteractionIface *iface)
+gcr_import_interaction_default_init (GcrImportInteractionInterface *iface)
{
- static size_t initialized = 0;
-
- if (g_once_init_enter (&initialized)) {
- g_once_init_leave (&initialized, 1);
- }
}
/**
@@ -74,12 +67,12 @@ void
gcr_import_interaction_supplement_prep (GcrImportInteraction *interaction,
GckBuilder *builder)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_if_fail (GCR_IS_IMPORT_INTERACTION (interaction));
g_return_if_fail (builder != NULL);
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
if (iface->supplement != NULL)
(iface->supplement_prep) (interaction, builder);
}
@@ -106,14 +99,14 @@ gcr_import_interaction_supplement (GcrImportInteraction *interaction,
GCancellable *cancellable,
GError **error)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORT_INTERACTION (interaction), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (builder != NULL, G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (error == NULL || *error == NULL, G_TLS_INTERACTION_UNHANDLED);
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
g_return_val_if_fail (iface->supplement != NULL, G_TLS_INTERACTION_UNHANDLED);
return (iface->supplement) (interaction, builder, cancellable, error);
@@ -141,13 +134,13 @@ gcr_import_interaction_supplement_async (GcrImportInteraction *interaction,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_if_fail (GCR_IS_IMPORT_INTERACTION (interaction));
g_return_if_fail (builder != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
g_return_if_fail (iface->supplement != NULL);
(iface->supplement_async) (interaction, builder, cancellable, callback, user_data);
@@ -171,13 +164,13 @@ gcr_import_interaction_supplement_finish (GcrImportInteraction *interaction,
GAsyncResult *result,
GError **error)
{
- GcrImportInteractionIface *iface;
+ GcrImportInteractionInterface *iface;
g_return_val_if_fail (GCR_IS_IMPORT_INTERACTION (interaction), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), G_TLS_INTERACTION_UNHANDLED);
g_return_val_if_fail (error == NULL || *error == NULL, G_TLS_INTERACTION_UNHANDLED);
- iface = GCR_IMPORT_INTERACTION_GET_INTERFACE (interaction);
+ iface = GCR_IMPORT_INTERACTION_GET_IFACE (interaction);
g_return_val_if_fail (iface->supplement != NULL, G_TLS_INTERACTION_UNHANDLED);
return (iface->supplement_finish) (interaction, result, error);