Hi,

I'm looking into adding a button to the NotationView that performs a
Command on each of the current segments. Basically, in the slot for a
piece of UI, I do:

    for (int i = 0; i < m_segments.size(); i++)
    {
        //getCommandHistory()->addCommand(new
MakeNotesViableCommand(*(m_segments[i])));
        getCommandHistory()->addCommand(new
AutoBeamCommand(*(m_segments[i])));
    }

What is wrong with that pattern?

If I do this, at first it seems to work fine, but I can reproduce a
crash pretty reliably by taking the following steps:
* create 2 (possibly empty) segments
* select the segments
* double-click them: they open in the Notation view
* click the UI element that fires this code, twice (i.e., causing 4
commands to be fired, 2 for each segment)
* hit 'undo' 2-4 times

This seems to trigger a crash (manifesting itself somewhere in the
NotationHLayout code) for any BasicSelectionCommand, regardless of the
setting for bruteForceRedo.

(of course eventually all those events I'm firing will be encapsulated
into one MacroCommand, but that comes down to essentially the same thing
and also causes a crash).

Any ideas?


Arnout

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to