talkatu/talkatu

Fix some warnings related to g_action_group_query_action
default tip
8 months ago, Gary Kramlich
42ce88fc5ee3
Parents 979e1d618007
Children
Fix some warnings related to g_action_group_query_action

Testing Done:
Compiled and verified the warnings were gone. Also ran the unit tests.

Reviewed at https://reviews.imfreedom.org/r/2558/
--- a/talkatu/talkatuactiongroup.c Thu Jul 20 00:25:47 2023 -0500
+++ b/talkatu/talkatuactiongroup.c Mon Aug 14 23:25:12 2023 -0500
@@ -333,8 +333,9 @@
GVariant *state = NULL;
const GVariantType *state_type = NULL;
gboolean enabled = FALSE;
+ gboolean found = FALSE;
- g_action_group_query_action(
+ found = g_action_group_query_action(
G_ACTION_GROUP(ag),
*action,
&enabled,
@@ -344,7 +345,7 @@
&state
);
- if(state_type == NULL) {
+ if(!found || state_type == NULL) {
continue;
}
@@ -915,11 +916,12 @@
GVariant *state = NULL;
const GVariantType *state_type = NULL;
gboolean enabled = FALSE;
+ gboolean found = FALSE;
g_return_val_if_fail(TALKATU_IS_ACTION_GROUP(ag), FALSE);
g_return_val_if_fail(name != NULL, FALSE);
- g_action_group_query_action(
+ found = g_action_group_query_action(
G_ACTION_GROUP(ag),
name,
&enabled,
@@ -929,7 +931,7 @@
&state
);
- if(state_type == NULL) {
+ if(!found || state_type == NULL) {
return FALSE;
}