From 4187eec127efe9c3ac920f1a0283896783103390 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Thu, 17 Feb 2022 16:36:20 +0100 Subject: [PATCH] notifier: Codestyle --- src/calls-notifier.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/calls-notifier.c b/src/calls-notifier.c index 2bcbe35..99235ac 100644 --- a/src/calls-notifier.c +++ b/src/calls-notifier.c @@ -44,6 +44,7 @@ struct _CallsNotifier G_DEFINE_TYPE (CallsNotifier, calls_notifier, G_TYPE_OBJECT); + static void notify (CallsNotifier *self, CuiCall *call) { @@ -109,17 +110,16 @@ state_changed_cb (CallsNotifier *self, /* Can use g_list_store_find with newer glib */ n = g_list_model_get_n_items (G_LIST_MODEL (self->unanswered)); - for (int i = 0; i < n; i++) - { - g_autoptr (CuiCall) item = g_list_model_get_item (G_LIST_MODEL (self->unanswered), i); - if (item == call) - { - g_list_store_remove (self->unanswered, i); - g_signal_handlers_disconnect_by_data (item, self); - } + for (int i = 0; i < n; i++) { + g_autoptr (CuiCall) item = g_list_model_get_item (G_LIST_MODEL (self->unanswered), i); + if (item == call) { + g_list_store_remove (self->unanswered, i); + g_signal_handlers_disconnect_by_data (item, self); } + } } + static void call_added_cb (CallsNotifier *self, CuiCall *call) { @@ -155,9 +155,7 @@ calls_notifier_constructed (GObject *object) calls = calls_manager_get_calls (calls_manager_get_default ()); for (c = calls; c != NULL; c = c->next) - { - call_added_cb (self, c->data); - } + call_added_cb (self, c->data); } @@ -182,6 +180,7 @@ calls_notifier_class_init (CallsNotifierClass *klass) object_class->dispose = calls_notifier_dispose; } + CallsNotifier * calls_notifier_new (void) {