Dear Chris or other knowledgable developer,

I just spent the day chasing what I believe to be dead code.

In src/gui/editors/NotationView.cpp
line 58:     m_commandRegistry = new NotationCommandRegistry(this);

This appears to do setup creation via the constructor NotationCommandRegistry().

We store the pointer in m_commandRegistry with I appears never to be used 
otherwise.

So, my thinking is that all actions of NotationCommandRegistry() should be 
moved to our setupActions() section and we should get rid of 
NotationCommandRegistry().

This is under the assumption the createAction handles all of this.  IS that 
correct?

What are your thoughts on this?

This leads me to my next question.  NotationCommandRegistry() calls many 
notation commands in sequence to apparently create actions for them and menu 
items, etc.

Let's use src/commands/notation/AddFingeringMarkCommand.cpp as an example.
It contains these functions all related to doing what createAction() does.
getStandardFingerings()
getArgument()
getActionName()

AddFingeringMarkCommand.h is only referenced to NotationCommandRegistry().
So if we removed these then the only function in AddFingeringMarkCommand.cpp 
are the functions:
AddFingeringMarkCommand() -- constructor in defined in header.
getGlobalName() which is only fed to the constructor
modifySegment() -- the actual command executed.

I'm not certain what to make of how getGlobalName() name is used.  I see that 
it was intended to be used for menu creation names, ID'ing the action name, and 
used as part of the undo, redo Sequence.  But doesn't createAction() handle 
this stuff via the name and text attributes in the .rc script?

It just looks like I'm either missing something, or this code just needs to go.

If so, how do I code the createAction() for these since I do not see a slot to 
call, or do I just use SLOT(slotInvokeCommand()) which is from 
CommandRegististry() class.

Some help would be nice be appreciated.

Sincerely,
Julie S.



      

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to