[Spice-devel] [PATCH spice-gtk 3/3] Remove "usbredirhost error: " prefix from usbredirhost error messages
Marc-André Lureau
mlureau at redhat.com
Wed Aug 1 17:08:22 PDT 2012
ack
----- Mensaje original -----
> libusbredirhost prefixes all its messages with "usbredirhhost ...: ",
> which
> is useful when logging to stderr, but not so much when showing the
> error
> to the user in an error dialog, so remove the "usbredirhost error: "
> prefix
> when we store the message in a GError.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
> gtk/channel-usbredir.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c
> index 354d2e1..cb2aed3 100644
> --- a/gtk/channel-usbredir.c
> +++ b/gtk/channel-usbredir.c
> @@ -448,8 +448,13 @@ static void usbredir_log(void *user_data, int
> level, const char *msg)
>
> if (priv->catch_error && level == usbredirparser_error) {
> SPICE_DEBUG("%s", msg);
> - g_set_error_literal(priv->catch_error, SPICE_CLIENT_ERROR,
> - SPICE_CLIENT_ERROR_FAILED, msg);
> + /* Remove "usbredirhost..." prefix from usbredirhost error
> messages */
> + if (strncmp(msg, "usbredirhost error: ", 20) == 0)
> + g_set_error_literal(priv->catch_error,
> SPICE_CLIENT_ERROR,
> + SPICE_CLIENT_ERROR_FAILED, msg +
> 20);
> + else
> + g_set_error_literal(priv->catch_error,
> SPICE_CLIENT_ERROR,
> + SPICE_CLIENT_ERROR_FAILED, msg);
> return;
> }
>
> --
> 1.7.10.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
More information about the Spice-devel
mailing list