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

Marc-André Lureau marcandre.lureau at gmail.com
Tue Nov 27 13:18:16 UTC 2012


Hi

On Tue, Nov 27, 2012 at 10:16 AM, Christophe Fergeau <cfergeau at redhat.com>wrote:

> > +/* -*- 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?
>

I wanted to be consistant with the rest of virt-viewer code. I agree in
general that it would be nicer to make virt-viewer LGPL. Daniel, do you
mind having LGPL code for that file? what is your opinion about switching
virt-viewer to LGPL by default?


> > +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?
>
>
Probably legacy: those values used to be flags fields before I turned them
to more descriptive boolean. I don't like the fact that GKeyFile may change
0 or 1 to true or false on your back either, but this is perhaps minor
(when using key_file_set_boolean), as we don't even have save helper atm,
although it could come quickly. And it could be more future-proof if it has
different values or behaviour later on, even if that can be handled by new
keys too..

Like many things, pros and cons.. Do you want to turn them in boolean then?

-- 
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20121127/37c7f2d7/attachment.htm>


More information about the virt-tools-list mailing list