diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/flashlight.c | 4 | ||||
-rw-r--r-- | src/service.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/flashlight.c b/src/flashlight.c index 064bd31..0a68af2 100644 --- a/src/flashlight.c +++ b/src/flashlight.c @@ -1,5 +1,6 @@ /* * Copyright 2017 The UBports project + * Copyright 2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Marius Gripsgard <marius@ubports.com> + * Robert Tari <robert@tari.in> */ #include "flashlight.h" @@ -145,7 +147,7 @@ toggle_flashlight_action(GAction *action, toggled = toggle_flashlight_action_simple(); if (toggled) - g_action_change_state(action, g_variant_new_boolean(!activated)); + g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean(!activated)); } int diff --git a/src/service.c b/src/service.c index 2731508..293a983 100644 --- a/src/service.c +++ b/src/service.c @@ -1,6 +1,6 @@ /* * Copyright 2013-2016 Canonical Ltd. - * Copyright 2021-2022 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -931,7 +931,7 @@ init_gactions (IndicatorPowerService * self) a = g_simple_action_new_stateful ("flashlight", pType, g_variant_new_boolean (FALSE)); g_variant_type_free (pType); g_action_map_add_action (G_ACTION_MAP(p->actions), G_ACTION(a)); - g_signal_connect(a, "activate", G_CALLBACK(toggle_flashlight_action), self); + g_signal_connect(a, "change-state", G_CALLBACK(toggle_flashlight_action), self); /* add the brightness action */ a = g_simple_action_new_stateful ("brightness", NULL, action_state_for_brightness (self)); |