On Fri, Dec 6, 2019 at 12:12 PM Frediano Ziglio <fzig...@redhat.com> wrote:

>
> In the title I would say "Factor out" instead of "Implement

 OK

> +static void spice_usb_device_widget_add_err_msg(SpiceUsbDeviceWidget
> *self,
> > +                                                gchar *new_err_msg)
>
> Why not spice_usb_device_widget_append_err_msg ?
> "add" seems to suggest a list of errors.
>
> But it is (or can be) a list of error messages.
See below, it even puts a newline after the old text.
As far as I understand, it prepares to handle multiple errors occurring one
after another while handling the same event.

> +    if (priv->err_msg) {
> > +        /* Append the new error message to err_msg,
> > +           but only if it's *not* already there! */
> > +        if (!strstr(priv->err_msg, new_err_msg)) {
> > +            gchar *old_err_msg = priv->err_msg;
> > +            priv->err_msg = g_strdup_printf("%s\n%s", old_err_msg,
> > new_err_msg);
>
_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to