[virt-tools-list] [PATCH virt-viewer 4/7] Add VirtViewerFile

Christophe Fergeau cfergeau at redhat.com
Tue Nov 27 09:16:50 UTC 2012


Hi,

Looks good, would be nice to add the documentation from the next email
somewhere in this commit. 2 small comments below. ACK.

Christophe

On Fri, Nov 23, 2012 at 01:41:09PM +0100, Marc-André Lureau wrote:
> diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
> new file mode 100644
> index 0000000..6ce76a1
> --- /dev/null
> +++ b/src/virt-viewer-file.c
> @@ -0,0 +1,775 @@
> +/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
> +/*
> + * Virt Viewer: A virtual machine console viewer
> + *
> + * Copyright (C) 2012 Red Hat, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or

Should we use LGPL here in case we want to move that code to a library?

> +gint
> +virt_viewer_file_get_fullscreen(VirtViewerFile* self)
> +{
> +    return virt_viewer_file_get_int(self, "fullscreen");
> +}
> +
> +void
> +virt_viewer_file_set_fullscreen(VirtViewerFile* self, gint value)
> +{
> +    virt_viewer_file_set_int(self, "fullscreen", value);
> +    g_object_notify(G_OBJECT(self), "fullscreen");
> +}

For the values that you document as being 0/1, the setter could do
virt_viewer_file_set_int(self, "fullscreen", !!value); to ensure that we
indeed write 0 or 1 in the file. Why not describe these properties as being
boolean and use a boolean property and g_key_file_get_boolean?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20121127/ed70a74d/attachment.sig>


More information about the virt-tools-list mailing list