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
Attachment:
pgp5B67s9kjEz.pgp
Description: PGP signature
_______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list