[Spice-devel] [PATCH spice-gtk 4/8] Notify when property changed

Hans de Goede hdegoede at redhat.com
Wed Nov 23 06:13:31 PST 2011


Hi,

On 11/23/2011 01:23 PM, Marc-André Lureau wrote:
> So that compatibility code with deprecated properties work
> ---
>   gtk/spice-gtk-session.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c
> index 116eead..c181c7e 100644
> --- a/gtk/spice-gtk-session.c
> +++ b/gtk/spice-gtk-session.c
> @@ -232,10 +232,12 @@ static void spice_gtk_session_set_property(GObject      *gobject,
>           break;
>       case PROP_AUTO_CLIPBOARD:
>           s->auto_clipboard_enable = g_value_get_boolean(value);
> +        g_object_notify(gobject, "auto-clipboard");
>           break;
>       case PROP_AUTO_USBREDIR:
>           s->auto_usbredir_enable = g_value_get_boolean(value);
>           spice_gtk_session_update_keyboard_focus(self, s->keyboard_focus);
> +        g_object_notify(gobject, "auto-usbredir");
>           break;
>       default:
>           G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);

Hmm, I don't think this is necessary:
1) AFAIK gobject will do the notify itself after calling the property setting,
so the only reason this would be necessary is for direct calls to the property
setter, which we don't do AFAIK. Also iirc I tested the compat code by using
it from spicy before modifying spicy and it used to work just fine without
these.

2) auto-usbredir is a new property and doesn't have any compat needs.

Regards,

Hans


More information about the Spice-devel mailing list