Re: Re: Why all the different string types?

Jens Miltner <[email protected]> Mon, 27 Mar 2006 06:34:05 +0200
Newsgroups gmane.comp.version-control.cvs.gui.devel
Message-ID <[email protected]>
Am 27.3.06 um 05:56 schrieb Guy Rouillier:

> Guy Rouillier wrote:
> I didn't receive any feedback regarding my idea about
> removing persistence from the data types and making that a property of
> the container, i.e., CvsPrefs.  I'd like to try to convert gCvs  
> settings
> to a plain text file before we release gCvs 2.0, so I'm going to  
> work on
> this next.  If there are no objections on the idea, I can come up with
> an initial implementation for purposes of discussion.  As I said  
> above,
> the resulting CvsPrefs should be much simpler since it would only  
> need a
> single method to store and retrieve any setting (getString,  
> putString.)
>   Of course, we'd add some wrappers around those two to make life
> easier: getInt, getBoolean, etc.

Just some thoughts:

At least for the global settings, MacCvs currently uses the  
preference APIs provided by the OS, which has the advantage of  
storing the prefs where they belong (among some others). Those APIs  
are not string only, i.e. there are native storage APIs for numbers,  
booleans, dates, etc. as well, which should be used if possible.

Essentially, when changing the CvsPrefs API, make sure the wrappers  
aren't pure wrappers but also allow them to contain the 'real'  
implementation for some platform.

Another thing to consider would be to make the sandbox settings  
local, i.e. don't use global variables to hold the values: at least  
MacCvs allows to open more than one sandbox browser simultaneously  
and currently, it's a bit of a hack to switch settings when a window  
comes to front (because settings are global in the current  
implementation).
I already started some work long ago to make the settings local, i.e.  
there would be a settings object that would get passed around and you  
could have multiple instances of settings objects, but never  
committed the work to the main branch (mainly because there were  
other, more important changes and after a while, the modified branch  
was completely out of sync). The code still exists on a branch, but  
it's probably more work to merge it than to come up with a new  
implementation now, especially if you're trying to get rid of the  
persistent objects anyway...

</jum>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cvsgui-dev/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/