Two questions about style:
First, I refactored a number of switch statements into classes. That much
I'm sure is OK, but it leaves me with 6 parameter pattern classes
(ParameterPattern, FlatParameterPattern, CrescendoParameterPattern, etc)
and a question of where to put them all. They are quite small: about 15
lines definition and 30 lines body. They just extend ParameterPattern via
virtual functions. Outside code only sees a pointer to the base.
How are these classes best fit into files?
* The base class declaration in a header, everything else in one cpp
file? Their declarations are apparently of little interest outside this
code.
* Each in their own header/cpp pair? More formally correct, but it
crowds some directory with 12 tiny new files.
* Each in their own header/cpp pair in a dedicated directory? Say,
src/base/parameterPatterns/ ?
I think they belong somewhere in src/base since they used by both gui code
(EventParameterDialog) and editor code (SelectionPropertyCommand).
Second, when I read up on tr to understand the freeze better, I realized
there's something called translation contexts that I don't know much
about. My tiny classes above call tr but aren't derived from QObject.
Should I:
* Just call tr as QObject::tr? That's what I wrote, but now I suspect
it's wrong.
* Call tr as EventParameterDialog::tr? Easy enough to switch. The calls
came from EventParameterDialog originally and the strings haven't
changed, so IIUC, this creates no new translation work.
* Derive my base from QObject and make it a new translation context?
That makes my tiny classes fatter, and they really don't do anything
widgety themselves. Not sure whether it makes new work for translators.
* Something else?
Tom Breton (Tehom)
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel