1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-14 00:17:35 +00:00

manager: Codestyle

We use two empty lines between functions, unless they are documented with
docstrings in which case there is only one empty line.
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-12-27 15:17:19 +01:00
parent 69b615a2c2
commit eab45610bd

View file

@ -85,6 +85,7 @@ enum {
}; };
static guint signals [SIGNAL_LAST_SIGNAL]; static guint signals [SIGNAL_LAST_SIGNAL];
static void static void
set_state (CallsManager *self, CallsManagerState state) set_state (CallsManager *self, CallsManagerState state)
{ {
@ -96,6 +97,7 @@ set_state (CallsManager *self, CallsManagerState state)
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_STATE]); g_object_notify_by_pspec (G_OBJECT (self), props[PROP_STATE]);
} }
static void static void
update_state (CallsManager *self) update_state (CallsManager *self)
{ {
@ -130,6 +132,7 @@ update_state (CallsManager *self)
set_state (self, CALLS_MANAGER_STATE_NO_ORIGIN); set_state (self, CALLS_MANAGER_STATE_NO_ORIGIN);
} }
static gboolean static gboolean
check_supported_protocol (CallsManager *self, check_supported_protocol (CallsManager *self,
const char *protocol) const char *protocol)
@ -147,6 +150,7 @@ check_supported_protocol (CallsManager *self,
return FALSE; return FALSE;
} }
/* This function will update self->supported_protocols from available provider plugins */ /* This function will update self->supported_protocols from available provider plugins */
static void static void
update_protocols (CallsManager *self) update_protocols (CallsManager *self)
@ -191,6 +195,7 @@ update_protocols (CallsManager *self)
update_state (self); update_state (self);
} }
static void static void
add_call (CallsManager *self, CallsCall *call, CallsOrigin *origin) add_call (CallsManager *self, CallsCall *call, CallsOrigin *origin)
{ {
@ -201,6 +206,7 @@ add_call (CallsManager *self, CallsCall *call, CallsOrigin *origin)
g_signal_emit (self, signals[SIGNAL_CALL_ADD], 0, call, origin); g_signal_emit (self, signals[SIGNAL_CALL_ADD], 0, call, origin);
} }
static void static void
remove_call (CallsManager *self, CallsCall *call, gchar *reason, CallsOrigin *origin) remove_call (CallsManager *self, CallsCall *call, gchar *reason, CallsOrigin *origin)
{ {
@ -212,6 +218,7 @@ remove_call (CallsManager *self, CallsCall *call, gchar *reason, CallsOrigin *or
g_signal_emit (self, signals[SIGNAL_CALL_REMOVE], 0, call, origin); g_signal_emit (self, signals[SIGNAL_CALL_REMOVE], 0, call, origin);
} }
static void static void
ussd_added_cb (CallsManager *self, ussd_added_cb (CallsManager *self,
char *response, char *response,
@ -223,6 +230,7 @@ ussd_added_cb (CallsManager *self,
g_signal_emit (self, signals[USSD_ADDED], 0, ussd, response); g_signal_emit (self, signals[USSD_ADDED], 0, ussd, response);
} }
static void static void
ussd_cancelled_cb (CallsManager *self, ussd_cancelled_cb (CallsManager *self,
CallsUssd *ussd, CallsUssd *ussd,
@ -234,6 +242,7 @@ ussd_cancelled_cb (CallsManager *self,
g_signal_emit (self, signals[USSD_CANCELLED], 0, ussd); g_signal_emit (self, signals[USSD_CANCELLED], 0, ussd);
} }
static void static void
ussd_state_changed_cb (CallsManager *self, ussd_state_changed_cb (CallsManager *self,
CallsUssd *ussd) CallsUssd *ussd)
@ -244,6 +253,7 @@ ussd_state_changed_cb (CallsManager *self,
g_signal_emit (self, signals[USSD_STATE_CHANGED], 0, ussd); g_signal_emit (self, signals[USSD_STATE_CHANGED], 0, ussd);
} }
static void static void
update_country_code_cb (CallsOrigin *origin, update_country_code_cb (CallsOrigin *origin,
GParamSpec *pspec, GParamSpec *pspec,
@ -261,6 +271,7 @@ update_country_code_cb (CallsOrigin *origin,
calls_settings_set_country_code (self->settings, country_code); calls_settings_set_country_code (self->settings, country_code);
} }
static void static void
add_origin (CallsManager *self, CallsOrigin *origin) add_origin (CallsManager *self, CallsOrigin *origin)
{ {
@ -291,12 +302,14 @@ add_origin (CallsManager *self, CallsOrigin *origin)
calls_origin_foreach_call (origin, (CallsOriginForeachCallFunc) add_call, self); calls_origin_foreach_call (origin, (CallsOriginForeachCallFunc) add_call, self);
} }
static void static void
remove_call_cb (gpointer self, CallsCall *call, CallsOrigin *origin) remove_call_cb (gpointer self, CallsCall *call, CallsOrigin *origin)
{ {
remove_call (self, call, NULL, origin); remove_call (self, call, NULL, origin);
} }
static void static void
remove_origin (CallsManager *self, CallsOrigin *origin) remove_origin (CallsManager *self, CallsOrigin *origin)
{ {
@ -360,6 +373,7 @@ rebuild_origins_by_protocols (CallsManager *self)
} }
} }
static void static void
remove_provider (CallsManager *self, remove_provider (CallsManager *self,
const char *name) const char *name)
@ -404,6 +418,7 @@ remove_provider (CallsManager *self,
g_signal_emit (self, signals[PROVIDERS_CHANGED], 0); g_signal_emit (self, signals[PROVIDERS_CHANGED], 0);
} }
static gboolean static gboolean
origin_found_in_any_provider (CallsManager *self, origin_found_in_any_provider (CallsManager *self,
CallsOrigin *origin) CallsOrigin *origin)
@ -430,7 +445,6 @@ origin_found_in_any_provider (CallsManager *self,
} }
static void static void
origin_items_changed_cb (GListModel *model, origin_items_changed_cb (GListModel *model,
guint position, guint position,
@ -486,6 +500,7 @@ origin_items_changed_cb (GListModel *model,
update_state (self); update_state (self);
} }
static void static void
add_provider (CallsManager *self, const gchar *name) add_provider (CallsManager *self, const gchar *name)
{ {
@ -521,6 +536,7 @@ add_provider (CallsManager *self, const gchar *name)
g_signal_emit (self, signals[PROVIDERS_CHANGED], 0); g_signal_emit (self, signals[PROVIDERS_CHANGED], 0);
} }
static void static void
calls_manager_get_property (GObject *object, calls_manager_get_property (GObject *object,
guint property_id, guint property_id,
@ -696,6 +712,7 @@ calls_manager_new (void)
return g_object_new (CALLS_TYPE_MANAGER, NULL); return g_object_new (CALLS_TYPE_MANAGER, NULL);
} }
CallsManager * CallsManager *
calls_manager_get_default (void) calls_manager_get_default (void)
{ {
@ -708,6 +725,7 @@ calls_manager_get_default (void)
return instance; return instance;
} }
CallsContactsProvider * CallsContactsProvider *
calls_manager_get_contacts_provider (CallsManager *self) calls_manager_get_contacts_provider (CallsManager *self)
{ {
@ -716,6 +734,7 @@ calls_manager_get_contacts_provider (CallsManager *self)
return self->contacts_provider; return self->contacts_provider;
} }
void void
calls_manager_add_provider (CallsManager *self, calls_manager_add_provider (CallsManager *self,
const char *name) const char *name)
@ -726,6 +745,7 @@ calls_manager_add_provider (CallsManager *self,
add_provider (self, name); add_provider (self, name);
} }
void void
calls_manager_remove_provider (CallsManager *self, calls_manager_remove_provider (CallsManager *self,
const char *name) const char *name)
@ -737,6 +757,7 @@ calls_manager_remove_provider (CallsManager *self,
update_protocols (self); update_protocols (self);
} }
gboolean gboolean
calls_manager_has_provider (CallsManager *self, calls_manager_has_provider (CallsManager *self,
const char *name) const char *name)
@ -747,6 +768,7 @@ calls_manager_has_provider (CallsManager *self,
return !!g_hash_table_lookup (self->providers, name); return !!g_hash_table_lookup (self->providers, name);
} }
gboolean gboolean
calls_manager_is_modem_provider (CallsManager *self, calls_manager_is_modem_provider (CallsManager *self,
const char *name) const char *name)
@ -771,6 +793,7 @@ calls_manager_get_state (CallsManager *self)
return self->state; return self->state;
} }
GListModel * GListModel *
calls_manager_get_origins (CallsManager *self) calls_manager_get_origins (CallsManager *self)
{ {
@ -779,6 +802,7 @@ calls_manager_get_origins (CallsManager *self)
return G_LIST_MODEL (self->origins); return G_LIST_MODEL (self->origins);
} }
GList * GList *
calls_manager_get_calls (CallsManager *self) calls_manager_get_calls (CallsManager *self)
{ {