Commit d1f53b1e authored by Debarshi Ray's avatar Debarshi Ray

GtkActionHelper: Remove unnecessary NULL check

This NULL check has existed since commit 652f16dd, when
GtkActionHelper was first introduced, but so has the assertion at the
top to ensure the validity of 'widget'.

https://bugzilla.gnome.org/show_bug.cgi?id=783587
parent aed628f1
...@@ -387,22 +387,17 @@ GtkActionHelper * ...@@ -387,22 +387,17 @@ GtkActionHelper *
gtk_action_helper_new (GtkActionable *widget) gtk_action_helper_new (GtkActionable *widget)
{ {
GtkActionHelper *helper; GtkActionHelper *helper;
GParamSpec *pspec;
g_return_val_if_fail (GTK_IS_ACTIONABLE (widget), NULL); g_return_val_if_fail (GTK_IS_ACTIONABLE (widget), NULL);
helper = g_object_new (GTK_TYPE_ACTION_HELPER, NULL); helper = g_object_new (GTK_TYPE_ACTION_HELPER, NULL);
helper->widget = GTK_WIDGET (widget); helper->widget = GTK_WIDGET (widget);
helper->enabled = gtk_widget_get_sensitive (GTK_WIDGET (helper->widget));
if (helper->widget) pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (helper->widget), "active");
{ if (pspec && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN)
GParamSpec *pspec; g_object_get (G_OBJECT (helper->widget), "active", &helper->active, NULL);
helper->enabled = gtk_widget_get_sensitive (GTK_WIDGET (helper->widget));
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (helper->widget), "active");
if (pspec && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN)
g_object_get (G_OBJECT (helper->widget), "active", &helper->active, NULL);
}
helper->action_context = _gtk_widget_get_action_muxer (GTK_WIDGET (widget), TRUE); helper->action_context = _gtk_widget_get_action_muxer (GTK_WIDGET (widget), TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment