diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2024-05-06 11:30:21 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2024-05-06 13:45:39 +0000 |
commit | 218d6d2c5879e97d5f564aff8fa2546212decdfa (patch) | |
tree | b5f1a32b09e8a858efc37799e9d79205ed10e904 /src/plugins/simtech/mm-shared-simtech.c | |
parent | 4afb6a3172ee78c64507932d63b4a081e4c2ad2d (diff) |
shared-simtech: use G_DECLARE|DEFINE_INTERFACE() macros
Diffstat (limited to 'src/plugins/simtech/mm-shared-simtech.c')
-rw-r--r-- | src/plugins/simtech/mm-shared-simtech.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/src/plugins/simtech/mm-shared-simtech.c b/src/plugins/simtech/mm-shared-simtech.c index 117ea65e..af89f4e0 100644 --- a/src/plugins/simtech/mm-shared-simtech.c +++ b/src/plugins/simtech/mm-shared-simtech.c @@ -30,6 +30,8 @@ #include "mm-shared-simtech.h" #include "mm-modem-helpers-simtech.h" +G_DEFINE_INTERFACE (MMSharedSimtech, mm_shared_simtech, MM_TYPE_IFACE_MODEM) + /*****************************************************************************/ /* Private data context */ @@ -94,11 +96,11 @@ get_private (MMSharedSimtech *self) /* Setup parent class' MMIfaceModemLocation and MMIfaceModemVoice */ - g_assert (MM_SHARED_SIMTECH_GET_INTERFACE (self)->peek_parent_location_interface); - priv->iface_modem_location_parent = MM_SHARED_SIMTECH_GET_INTERFACE (self)->peek_parent_location_interface (self); + g_assert (MM_SHARED_SIMTECH_GET_IFACE (self)->peek_parent_location_interface); + priv->iface_modem_location_parent = MM_SHARED_SIMTECH_GET_IFACE (self)->peek_parent_location_interface (self); - g_assert (MM_SHARED_SIMTECH_GET_INTERFACE (self)->peek_parent_voice_interface); - priv->iface_modem_voice_parent = MM_SHARED_SIMTECH_GET_INTERFACE (self)->peek_parent_voice_interface (self); + g_assert (MM_SHARED_SIMTECH_GET_IFACE (self)->peek_parent_voice_interface); + priv->iface_modem_voice_parent = MM_SHARED_SIMTECH_GET_IFACE (self)->peek_parent_voice_interface (self); g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free); } @@ -1237,25 +1239,6 @@ mm_shared_simtech_voice_check_support (MMIfaceModemVoice *self, /*****************************************************************************/ static void -shared_simtech_init (gpointer g_iface) -{ -} - -GType -mm_shared_simtech_get_type (void) +mm_shared_simtech_default_init (MMSharedSimtechInterface *iface) { - static GType shared_simtech_type = 0; - - if (!G_UNLIKELY (shared_simtech_type)) { - static const GTypeInfo info = { - sizeof (MMSharedSimtech), /* class_size */ - shared_simtech_init, /* base_init */ - NULL, /* base_finalize */ - }; - - shared_simtech_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedSimtech", &info, 0); - g_type_interface_add_prerequisite (shared_simtech_type, MM_TYPE_IFACE_MODEM_LOCATION); - } - - return shared_simtech_type; } |