<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 27, 2012 at 10:55 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<div><div class="h5"><br>
On Fri, Nov 23, 2012 at 01:41:12PM +0100, Marc-André Lureau wrote:<br>
> ---<br>
>  src/remote-viewer.c | 25 +++++++++++++++++++++++--<br>
>  1 file changed, 23 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/remote-viewer.c b/src/remote-viewer.c<br>
> index 72b1ca8..553f251 100644<br>
> --- a/src/remote-viewer.c<br>
> +++ b/src/remote-viewer.c<br>
> @@ -35,6 +35,7 @@<br>
>  #include "virt-viewer-session-spice.h"<br>
>  #endif<br>
>  #include "virt-viewer-app.h"<br>
> +#include "virt-viewer-file.h"<br>
>  #include "remote-viewer.h"<br>
><br>
>  #ifndef G_VALUE_INIT /* see bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=654793" target="_blank">https://bugzilla.gnome.org/show_bug.cgi?id=654793</a> */<br>
> @@ -626,9 +627,13 @@ remote_viewer_start(VirtViewerApp *app)<br>
>      RemoteViewer *self = REMOTE_VIEWER(app);<br>
>      RemoteViewerPrivate *priv = self->priv;<br>
>  #endif<br>
> +    GFile *file = NULL;<br>
> +    VirtViewerFile *vvfile = NULL;<br>
>      gboolean ret = FALSE;<br>
>      gchar *guri = NULL;<br>
>      gchar *type = NULL;<br>
> +    gchar *path = NULL;<br>
> +    GError *error = NULL;<br>
><br>
>  #if HAVE_SPICE_GTK<br>
>      g_signal_connect(app, "notify", G_CALLBACK(app_notified), self);<br>
> @@ -659,7 +664,17 @@ remote_viewer_start(VirtViewerApp *app)<br>
>          if (virt_viewer_app_get_title(app) == NULL)<br>
>              virt_viewer_app_set_title(app, guri);<br>
><br>
> -        if (virt_viewer_util_extract_host(guri, &type, NULL, NULL, NULL, NULL) < 0 || type == NULL) {<br>
> +        file = g_file_new_for_commandline_arg(guri);<br>
> +        if (g_file_query_exists(file, NULL)) {<br>
> +            path = g_file_get_path(file);<br>
> +            vvfile = virt_viewer_file_new(path, &error);<br>
<br>
</div></div>I'd make 'error' and 'path' local to that block, the function is a bit big,<br>
so that makes less things to mentally track for the whole function. Looks<br>
good apart from this.<br clear="all"></blockquote><div><br>ok, I'll try to split it with a seperate function, since using local variable make the cleanup handling more complicated.<br></div></div><br>-- <br>Marc-André Lureau<br>

</div>