diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-07-28 11:37:37 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2012-07-30 13:30:03 +0200 |
commit | 88a1eff2f24eeb82e7c20b3dc46e01bc61554ef2 (patch) | |
tree | 3da9bf2b9e469af2242be8edeb83ad751984d55d | |
parent | 498cc2677dc75a9d868c748bea08a07f82ce9d3d (diff) |
Remove "usbredirhost: " prefix from usbredirhost error messages
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: " prefix
when we store the message in a GError.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | gtk/channel-usbredir.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c index 354d2e1..e7e5629 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 messages */ + if (strncmp(msg, "usbredirhost: ", 14) == 0) + g_set_error_literal(priv->catch_error, SPICE_CLIENT_ERROR, + SPICE_CLIENT_ERROR_FAILED, msg + 14); + else + g_set_error_literal(priv->catch_error, SPICE_CLIENT_ERROR, + SPICE_CLIENT_ERROR_FAILED, msg); return; } |