Re: gCvs popup menu customization, future plans

Jens Miltner <[email protected]> Wed, 15 Feb 2006 01:22:27 +0100
Newsgroups gmane.comp.version-control.cvs.gui.devel
Message-ID <[email protected]>
Am 14.2.06 um 09:15 schrieb Richard Wirth:

> But I'm not verry happy with the persistent format in general. It is
> raw binary, and this complete machine dependent. So one can not move
> its setup from one computer to another. Also there is no easy way in
> migrating existing setups when new fearures are added. So I often
> thought about storing prefernces in clear text. But that will imply a
> lot of work, cause there isn't an easy way for transforming binary
> complex data into text...

FWIW, MacCvs is using the Mac OS built-in preference APIs, which  
essentially knows about Booleans, numbers, strings, arrays and  
dictionaries (aka maps) as well as BLOBs. I didn't want to write out  
the values in binary format for pretty much the same reasons you  
mentioned (plus I wanted a way to fiddle with them for debugging  
purposes ;-). I found that I can map all CPersistent subclasses onto  
one of those types and it works well.
The only drawback is that the code in CPersistent that reads & writes  
the settings needs to know just a little bit too much about the  
specific subclasses to be able to "translate" between the Mac OS  
Preferences format and the cvsgui CPersistent structure. It's not a  
real problem, it's just not nice to have the base class know about  
specific subclass details. (This could easily be solved by providing  
virtual members that return one of the OS pref values and factories  
that know how to construct cvsgui objects from the OS prefs, etc.,  
but it would actually make the code even more platform specific, so I  
decided to go the 'ugly' way).

I guess what I'm trying to say is that it should not be too  
complicated to write out the persistent values in text format if you  
just sit down and determine which basic types you need to support and  
what would be an appropriate textual format for the settings file.



 
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/