[virt-tools-list] [PATCH virt-viewer 4/7] Add VirtViewerFile
Christophe Fergeau
cfergeau at redhat.com
Tue Nov 27 13:35:09 UTC 2012
On Tue, Nov 27, 2012 at 02:18:16PM +0100, Marc-André Lureau wrote:
> > 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?
I was just wondering if you had considered that. I agree with the fact that
it leaves more room with future extensions. With that in mind, we should
normalize the values to 0/1 with !! when writing them though (or
g_return_if_fail if you think this should be reported as a programming
error).
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/ceddea2c/attachment.sig>
More information about the virt-tools-list
mailing list