Re: [PATCH 4/9] Implement spice_usb_device_widget_add_err_msg() in usb-device-widget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 6, 2019 at 12:12 PM Frediano Ziglio <fziglio@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]