<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 4:23 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ACK<br>
<div class=""><div class="h5"><br>
On Mon, Oct 06, 2014 at 01:52:43PM +0200, Fabiano Fidêncio wrote:<br>
> SpiceChannelError, for now, will be used to set more detailed errors<br>
> with respect to the main channel event SPICE_CHANNEL_ERROR_AUTH.<br>
> ---<br>
> Changes since v1:<br>
> - Change the SpiceChannelAuthError comments to match with the enum values<br>
> - Add more details related to SPICE_CHANNEL_ERROR_AUTH<br>
> ---<br>
>  doc/reference/spice-gtk-sections.txt |  3 +++<br>
>  gtk/map-file                         |  2 ++<br>
>  gtk/spice-channel.c                  | 11 +++++++++++<br>
>  gtk/spice-channel.h                  | 25 +++++++++++++++++++++++++<br>
>  gtk/spice-glib-sym-file              |  2 ++<br>
>  5 files changed, 43 insertions(+)<br>
><br>
> diff --git a/doc/reference/spice-gtk-sections.txt b/doc/reference/spice-gtk-sections.txt<br>
> index caaa92c..5c411f8 100644<br>
> --- a/doc/reference/spice-gtk-sections.txt<br>
> +++ b/doc/reference/spice-gtk-sections.txt<br>
> @@ -73,6 +73,9 @@ spice_main_clipboard_release<br>
>  spice_main_clipboard_notify<br>
>  spice_main_clipboard_request<br>
>  <SUBSECTION Standard><br>
> +SPICE_CHANNEL_ERROR<br>
> +spice_channel_error_get_type<br>
> +spice_channel_error_quark<br>
>  SPICE_MAIN_CHANNEL<br>
>  SPICE_IS_MAIN_CHANNEL<br>
>  SPICE_TYPE_MAIN_CHANNEL<br>
> diff --git a/gtk/map-file b/gtk/map-file<br>
> index 90f14f1..c1d9e71 100644<br>
> --- a/gtk/map-file<br>
> +++ b/gtk/map-file<br>
> @@ -6,6 +6,8 @@ spice_audio_new;<br>
>  spice_channel_connect;<br>
>  spice_channel_destroy;<br>
>  spice_channel_disconnect;<br>
> +spice_channel_error_get_type;<br>
> +spice_channel_error_quark;<br>
>  spice_channel_event_get_type;<br>
>  spice_channel_get_error;<br>
>  spice_channel_get_type;<br>
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c<br>
> index 5d1a86e..a8b4e35 100644<br>
> --- a/gtk/spice-channel.c<br>
> +++ b/gtk/spice-channel.c<br>
> @@ -76,6 +76,17 @@ static void spice_channel_send_migration_handshake(SpiceChannel *channel);<br>
><br>
>  G_DEFINE_TYPE(SpiceChannel, spice_channel, G_TYPE_OBJECT);<br>
><br>
> +/**<br>
> + * SpiceChannelError:<br>
> + *<br>
> + * The error domain for the spice channel.<br>
> + **/<br>
> +GQuark<br>
> +spice_channel_error_quark(void)<br>
> +{<br>
> +  return g_quark_from_static_string ("spice-channel-error");<br>
> +}<br>
> +<br>
>  /* Properties */<br>
>  enum {<br>
>      PROP_0,<br>
> diff --git a/gtk/spice-channel.h b/gtk/spice-channel.h<br>
> index 1c303b4..adbe8f5 100644<br>
> --- a/gtk/spice-channel.h<br>
> +++ b/gtk/spice-channel.h<br>
> @@ -32,6 +32,17 @@ G_BEGIN_DECLS<br>
>  #define SPICE_IS_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_CHANNEL))<br>
>  #define SPICE_CHANNEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_CHANNEL, SpiceChannelClass))<br>
><br>
> +/**<br>
> + * SPICE_CHANNEL_ERROR:<br>
> + *<br>
> + * Error domain for #SpiceChannel operations. Error in this domain will be<br>
> + * from the SpiceChannelError enumeration. See #GError for more<br>
> + * information on error domains.<br>
> + **/<br>
> +#define SPICE_CHANNEL_ERROR           spice_channel_error_quark ()<br>
> +<br></div></div></blockquote><div><br></div><div>SPICE_CHANNEL_ERROR_* is unfortunately already used in SpiceChannelEvent enum.<br><br>Why not add error values to SpiceClientError instead? This is the generic error domain for all spice-gtk I am not sure we need other domains.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
> +GQuark spice_channel_error_quark(void);<br>
> +<br>
>  typedef struct _SpiceMsgIn  SpiceMsgIn;<br>
>  typedef struct _SpiceMsgOut SpiceMsgOut;<br>
><br>
> @@ -61,6 +72,20 @@ typedef enum<br>
>      SPICE_CHANNEL_ERROR_IO,<br>
>  } SpiceChannelEvent;<br>
><br>
> +/**<br>
> + * SpiceChannelAuthError:<br>
> + * @SPICE_CHANNEL_ERROR_AUTH_NEEDS_PASSWORD: password is required<br>
> + * @SPICE_CHANNEL_ERROR_AUTH_NEEDS_PASSWORD_AND_USERNAME: username and password are required<br>
> + *<br>
> + * An error, used as detailed info for SPICE_CHANNEL_ERROR_AUTH, a main channel event, that<br>
> + * should be verified by the applications using spice_channel_get_error().<br>
> + **/<br>
> +typedef enum<br>
> +{<br>
> +    SPICE_CHANNEL_ERROR_AUTH_NEEDS_PASSWORD,<br>
> +    SPICE_CHANNEL_ERROR_AUTH_NEEDS_PASSWORD_AND_USERNAME,<br>
> +} SpiceChannelError;<br>
> +<br>
>  struct _SpiceChannel<br>
>  {<br>
>      GObject parent;<br>
> diff --git a/gtk/spice-glib-sym-file b/gtk/spice-glib-sym-file<br>
> index 878dd12..69e3e83 100644<br>
> --- a/gtk/spice-glib-sym-file<br>
> +++ b/gtk/spice-glib-sym-file<br>
> @@ -4,6 +4,8 @@ spice_audio_new<br>
>  spice_channel_connect<br>
>  spice_channel_destroy<br>
>  spice_channel_disconnect<br>
> +spice_channel_error_get_type<br>
> +spice_channel_error_quark<br>
>  spice_channel_event_get_type<br>
>  spice_channel_flush_async<br>
>  spice_channel_flush_finish<br>
> --<br>
> 2.1.0<br>
><br>
> _______________________________________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</div></div><br>_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div></div>