kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #13633
Re: Static variables in module editor
On Tue, Jun 10, 2014 at 10:18:57AM +0200, Maciej Sumiński wrote:
> Hi,
>
> I have found a few static variables in the module editor code that I would
> like to remove, but I need to know your opinion. The variables are used to
> keep the last edited module between editor invocations.
Ah these. I stumbled in them, too... the 'default' thing in pcbnew often
works only the first time, until you confirm something; after that, it
becomes the new default. Example, text size: default text size is saved
in the ini file from the settings and it's used the first time you add
text. However when you edit the text side of an object, *that* becomes
the new default until you restart pcbnew or edit another object. So it's
"default until I have another value picked as default". Curious but it
actually works well.
> If we want to preserve such behaviour, I will need to add a few more static
> variables (for sure VIEW, maybe VIEW_CONTROLS and some stuff related to the
> Tool Framework). I would rather avoid such solution.
For the OO purists statics are Evil. YMMV. For the current behaviour
I think they are the best solution.
> Furthermore, the footprint stored in the editor is completely independent -
> it is not bound to anything on board or library. Do we need to keep it? If
> there is a modification done, the user is asked if he wants to save his work
> or update a footprint, so there is a little chance of losing data.
Yes, ATM the footprint is untied from the board and everything
(correctly, since it lives in the library). Layers are always the
'stock' ones. Still an undecided point in the 'more layer proposal' if
libraries will have their own layer set or whatever.
--
Lorenzo Marcantonio
Logos Srl
Follow ups
References