← Back to team overview

kicad-developers team mailing list archive

Re: Static variables in module editor

 

On 10.06.2014 16:40, Dick Hollenbeck wrote:

I clicked send, replying to Lorenzo's comment right when your next
e-mail came. Sorry for that,


Thanks Tom, apology accepted.

Another thing we get by supporting multiple open projects and paste, is we are only one
step away (i.e. COPY) from having copy and paste across projects, and therefore libraries.

This is leaner than the current methodology of having to switch "current libraries" to
move a footprint from one to another.  And while yes code improvements could also have
brought this, what we're seeing with this multiple project approach is the footprint
movement support *without changing existing code* to any great extent.   That sounds like
free to me.

Dick,

I don't see any issue with adding copy/paste and using s-exprs is the right way of doing so. But this discussion was about getting rid of a bunch of static variables.

My proposal would be to:
1. Remove the statics, temporarily removing the retain-last-edited-footprint feature.
2. Add copy/paste in both pcbnew main window and the module editor.
3. Once the copy/paste code is verified, use PROJECT::GetRString() to bring back the last footprint feature.

This way we would have ultimately less coding to do at the cost of temporarily disabling a feature that is IMHO not absolutely necessary for Kicad to work.

BTW. A little suggestion for Get/SetRString(): how about changing the enum index to a string? This way we'd have one less enum to manage and won't have to recompile everything whenever a new RString is added.

Regards,
Tom



Follow ups

References