[gtk/mjog/mute-actionhelper-null-target-warning] actionhelper: Mute warnings for actions with null targets
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/mjog/mute-actionhelper-null-target-warning] actionhelper: Mute warnings for actions with null targets
- Date: Wed, 30 Oct 2019 05:14:30 +0000 (UTC)
commit 352e74a316c3cc25c8d1a29593f08c71bf35c3ec
Author: Michael Gratton <mike vee net>
Date: Wed Oct 30 16:02:12 2019 +1100
actionhelper: Mute warnings for actions with null targets
There's currently no way for actions parameterised with a target to be
disabled on a per-target basis, except by setting the target to be
null. This causes actionhelper to mark the associated widget as
insensitive as desired, but also print a warning about the target's
type being invalid.
This patch mutes the warning only in case the target is null, if the
target is otherwise the incorrect type then the warning will still be
printed.
gtk/gtkactionhelper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkactionhelper.c b/gtk/gtkactionhelper.c
index c5f4356b2b..bc13d53ddc 100644
--- a/gtk/gtkactionhelper.c
+++ b/gtk/gtkactionhelper.c
@@ -145,14 +145,14 @@ gtk_action_helper_action_added (GtkActionHelper *helper,
(helper->target != NULL && parameter_type != NULL &&
g_variant_is_of_type (helper->target, parameter_type));
- if (!helper->can_activate)
+ if (helper->target != NULL && !helper->can_activate)
{
g_warning ("%s: action %s can't be activated due to parameter type mismatch "
"(parameter type %s, target type %s)",
"actionhelper",
helper->action_name,
parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
- helper->target ? g_variant_get_type_string (helper->target) : "NULL");
+ g_variant_get_type_string (helper->target));
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]