shell: Fix warnings for the GVariant-encoded parameters
This fixes a spurious warning about ignored parameters due to the variant not being NULL since it now contains the flags dictionary. https://bugzilla.gnome.org/show_bug.cgi?id=700530
This commit is contained in:
parent
d78bc9772a
commit
4e42a36133
1 changed files with 21 additions and 1 deletions
|
@ -83,9 +83,29 @@ cc_panel_set_property (GObject *object,
|
|||
case PROP_PARAMETERS:
|
||||
{
|
||||
GVariant *parameters = g_value_get_variant (value);
|
||||
GVariant *v;
|
||||
gsize n_parameters;
|
||||
|
||||
if (parameters)
|
||||
if (parameters == NULL)
|
||||
return;
|
||||
|
||||
n_parameters = g_variant_n_children (parameters);
|
||||
if (n_parameters == 0)
|
||||
return;
|
||||
|
||||
g_variant_get_child (parameters, 0, "v", &v);
|
||||
|
||||
if (!g_variant_is_of_type (v, G_VARIANT_TYPE_DICTIONARY))
|
||||
g_warning ("Wrong type for the first argument GVariant, expected 'a{sv}' but got '%s'",
|
||||
(gchar *)g_variant_get_type (v));
|
||||
else if (g_variant_n_children (v) > 0)
|
||||
g_warning ("Ignoring additional flags");
|
||||
|
||||
g_variant_unref (v);
|
||||
|
||||
if (n_parameters > 1)
|
||||
g_warning ("Ignoring additional parameters");
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue