[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

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


Attachment: pgp2uoYRsy9I8.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]