Re: Global Proxy Settings



Jonathan Blandford <jrb redhat com> writes:
> "James M. Cape" <jcape ignore-your tv> writes:
> > On Fri, 2001-12-28 at 01:16, Jonathan Blandford wrote:
> > > "James M. Cape" <jcape ignore-your tv> writes:
> > > 
> > > > So far, I have these keys:
> > > > 
> > > > int /system/proxy/type:
> > > >     Default: 0
> > > >         None (0)
> > > >         HTTP (1)
> > > >         WinGate (2)
> > > >         SOCKS4 (3)
> > > >         SOCKS5 (4)
> > > 
> > > Maybe use a string here instead of a pseudo enum?
> > 
> > Ok... uhh... why? :-)
> 
> More extensible.  More readable from a gconf-editor.

GConf has a convenience function (something about string_from_enum, I
forget) to help with this. 

The reason to use strings is that it's more human-readable and
human-editable, and it keeps you from just casting the int from gconf
to an enum value, which is fragile if you change the enum in your
code. e.g. in a newer version you might dump one of the enum values.

It's just your basic "magic numbers bad" kind of style issue.

Havoc



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