[Spice-devel] [PATCH vdagent 02/11] vdagent: remove fx_dir magic values

Christophe Fergeau cfergeau at redhat.com
Tue Oct 3 06:14:54 UTC 2017


I've seen the follow-up discussion to that patch, but I thought I'd
mention this commit should have more than just a short log as it has a
user-visible impact. If someone wants to know in 2 years *why* we
removed the option, this should be clear from the commit log (and would
help with the discussion too to know the rationale)

Christophe

On Tue, Sep 26, 2017 at 10:59:38PM +0200, Jakub Janků wrote:
> ---
>  src/vdagent/vdagent.c | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
> index dfb9284..6b4c127 100644
> --- a/src/vdagent/vdagent.c
> +++ b/src/vdagent/vdagent.c
> @@ -168,7 +168,7 @@ static void usage(FILE *fp)
>        "  -s <port>                         set virtio serial port\n"
>        "  -S <filename>                     set udcs socket\n"
>        "  -x                                don't daemonize\n"
> -      "  -f <dir|xdg-desktop|xdg-download> file xfer save dir\n"
> +      "  -f <dir>                          file xfer save dir\n"
>        "  -o <0|1>                          open dir on file xfer completion\n",
>        VERSION);
>  }
> @@ -313,18 +313,13 @@ reconnect:
>          return 1;
>      }
>  
> -    if (!fx_dir) {
> -        if (vdagent_x11_has_icons_on_desktop(x11))
> -            fx_dir = "xdg-desktop";
> -        else
> -            fx_dir = "xdg-download";
> -    }
> +    if (!fx_dir)
> +        fx_dir = g_get_user_special_dir(vdagent_x11_has_icons_on_desktop(x11) ?
> +                                        G_USER_DIRECTORY_DESKTOP :
> +                                        G_USER_DIRECTORY_DOWNLOAD);
>      if (fx_open_dir == -1)
>          fx_open_dir = !vdagent_x11_has_icons_on_desktop(x11);
> -    if (!strcmp(fx_dir, "xdg-desktop"))
> -        fx_dir = g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP);
> -    else if (!strcmp(fx_dir, "xdg-download"))
> -        fx_dir = g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD);
> +
>      if (fx_dir) {
>          vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,
>                                                         fx_open_dir, debug);
> -- 
> 2.13.5
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20171003/423ddd4c/attachment-0001.sig>


More information about the Spice-devel mailing list